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.
It is not flaw, it is supposed to work like that. Because leading zeros have no meaning in math. this code is_palindrome() returns false for 100 and it is correct. Or are you claiming that 100 is palindrome?
Have look at basic math here; https://en.wikipedia.org/wiki/Leading_zero
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Java Lambda Expressions
You are viewing a single comment's thread. Return to all comments →
It is not flaw, it is supposed to work like that. Because leading zeros have no meaning in math. this code is_palindrome() returns false for 100 and it is correct. Or are you claiming that 100 is palindrome? Have look at basic math here; https://en.wikipedia.org/wiki/Leading_zero