• + 1 comment

    No i agree with you that it should check the even condition but i dont know what is wrong with the hackerank testing arlgorithm that it is only considering number between 6 to 20(irrespective of even or odd).Go ahead submit the code without n%2==0 condition it does follow all test cases correctly.Thats why i said code is not asking you to check even condition.