Ad
  • Custom User Avatar

    Peformance tag should be added , i solved it but i got timeout error because my solution is O(n) ,
    i should find another way to solve it and hate this really because im still beginner and i did not know its need a solution O(log n) :(

  • Custom User Avatar

    The description of the second function does not make much sense to me, am I missing something? How can n=0 (which you even test) if the argument to the function f is {1,...,n} and 1 <= x <= n? This seems paradoxical to me.