Solved LeetCode program · 220 of 1,000
#0275 · H-Index II
Original English source
Keep a shared numbers holding 0, 1, 3, 5, and 6. 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 4.
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