Ad
  • Custom User Avatar

    The only change you did, is wrong. Take a look at n value, it's wrong too (and maybe there are more errors). In fact, you're setting it as -inf every time and your loop doesn't even run. You also overwrite n.
    I have two solutions that worked in C++ and there are 781 C++ completions already, the problem is in your code. Read the instructions again, fix all the errors or start again checking every step.

  • Custom User Avatar

    Not a kata issue, your code is wrong, and I already explained why you see 1 instead of true or 0 instead of false here

    Read the description and check this example again:

    inAscOrder([1,2,4,7,19]); // returns true
    

    Do you see what's wrong with your code now?

  • Custom User Avatar

    That's not a problem, your code is wrong. When you return true it'll show a 1 and when you return false it'll show a 0 but the comparison with a boolean will work.
    You can check this returning true or false and checking if it passes one of the sample tests. You can read more here: https://www.w3schools.com/cpp/cpp_booleans.asp