DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Abubakar Sadiq Ismail
Abubakar Sadiq Ismail

Posted on

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)

An Animated Guide to Node.js Event Loop

Node.js doesn’t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.