Solved LeetCode program · 219 of 1,000
#0274 · H-Index
Original English source
Keep a shared numbers holding 3, 0, 6, 1, and 5. Keep a shared seek of 0. Keep a shared tally of 0.
To gather from spot (a whole number) with last (a whole number). If spot is more than last, return. If item spot of numbers is at least seek, add 1 to tally. Gather from spot plus 1 with last.
The best is 0.
For every level from 0 to 5.
Set seek to level. Set tally to 0. Gather from 0 with 4. If tally is at least level, set best to level.
Show best.
Expected stdout
3