We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java If-Else
You are viewing a single comment's thread. Return to all comments →
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.