DEV Community

Abubakar Sadiq Ismail
Abubakar Sadiq Ismail

Posted on

1 1

Day 3 I4G 10 days of code challenge

Early in the morning after I wake up, I decided to start with todays code challenge before anything else;

The problem was given an integer you return true when it's a palindrome, else return false.
Palindrome are numbers,phrase or strings that when reversed the result is the same number;
e.g 1221 is a palindrome and will return true. 1234 is not a palindrome and will return false.

The solution i think is to covert the integer to a string;
Reverse the string;
Convert the reversed string to an integer;
Compare the original integer and the reversed Integer,
If they are the same return true
Else return false

Time complexity
O(n)
Space complexity
O(n)
Leetcode problem
Link to Implementation

Top comments (0)

SurveyJS custom survey software

Build Your Own Forms without Manual Coding

SurveyJS UI libraries let you build a JSON-based form management system that integrates with any backend, giving you full control over your data with no user limits. Includes support for custom question types, skip logic, an integrated CSS editor, PDF export, real-time analytics, and more.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay