numberOfPoolBallRows(balls)

numberOfPoolBallRows(balls)

This problem is the inverse of the previous problem. Write the function numberOfPoolBallRows(balls) that takes a non-negative int number of pool balls, and returns the smallest int number of rows required for the given number of pool balls. Thus, numberOfPoolBallRows(6) returns 3. Note that if any balls must be in a row, then you count that row, and so numberOfPoolBallRows(7) returns 4 (since the 4th row must have a single ball in it).

信息

ID
1014
难度
(无)
分类
(无)
标签
(无)
递交数
0
已通过
0
通过率
?
上传者