My LeetCode grinding. Trying to do a problem a day.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

12345678910111213141516171819202122232425262728
  1. You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins.
  2. Given n, find the total number of full staircase rows that can be formed.
  3. n is a non-negative integer and fits within the range of a 32-bit signed integer.
  4. Example 1:
  5. n = 5
  6. The coins can form the following rows:
  7. ¤
  8. ¤ ¤
  9. ¤ ¤
  10. Because the 3rd row is incomplete, we return 2.
  11. Example 2:
  12. n = 8
  13. The coins can form the following rows:
  14. ¤
  15. ¤ ¤
  16. ¤ ¤ ¤
  17. ¤ ¤
  18. Because the 4th row is incomplete, we return 3.