More explanations for the problem


  • 2
    T

    Actually, I think this problem needs more explanations.
    X is not the perfect square number, besides, we want to find the closest int which is smaller than or equals to exact sqrt(x).


  • 0
    L

    The problem's type of the return value is int, so it's clear to find the closet int which is smaller than or equals to exact sqrt(x).


  • 0
    T

    At the beginning, we had the same idea. After I passed the test, I know what I posted is what this problem want.


  • 0
    M

    @liushu1231 said in More explanations for the problem:

    The problem's type of the return value is int, so it's clear to find the closet int which is smaller than or equals to exact sqrt(x).

    IT IS NOT CLEAR AT ALL!
    SQRT(15) is what? 3.87... something. Should I round it up or just strip off to 3?


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.