Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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?
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?
This comment is hidden because it contains spoiler information about the solution
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?