Ad
  • Custom User Avatar

    Does the hint help to do away with the need for double for-loops? I initially thought the math was supposed to be used to narrow down the loop conditions for x and y in the original post. Am i mistaken?

  • Custom User Avatar

    Hey guys, I am passing all the sample test cases but am constantly timing out.

    For me, my algorithm runs x from square root of n up till n, and for each iteration of x, runs another y from 0 up till half of x.

    i.e. Sqrt(n) <= x <= n and 0 <= y < (1/2)x

    I got the above equalities by playing with the conditions provided. What have I missed out that is making my loop so inefficient?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Hey guys, I have a minor question.

    I thought that when the question mentioned that we needed to state the types so I declared my function as public static Function<Student, Boolean> f instead of public static Function<Student, boolean> f as i thought that to declare a boolean tyoe, i must declare as boolean instead of Boolean.

    I a little confused why though, as i had always assumed that the type of booleans was boolean. Can someone help clarify?