Any number that reads the same way forwards as it does backwards is a palindrome. For instance, 12321
would be considered a palindrome, whereas 123
would not be.
Write a function that takes in an integer and returns the next palindrome. For instance:
findNextPalindrome(100)
// should return 101
and
findNextPalindrome(101)
// should return 111
- Copy this markdown and paste in your own, private gist
- In your private gist, fill out the questions below
- Submit by the due time as instructed in Zoom
Given a starting number, return the closest palindrome to the starting number.
What assumptions will you make about this problem if you cannot ask any more clarifying questions? What are your reasons for making those assumptions?
I will be given a number I will be counting upwards only There will be no number to count up to
This problem will require a standard for loop with a return. It will also need a function to check for the palindrome within the number.
- Searching of Data
- Sorting of Data
- Pattern Recognition
- Build/Navigate a Grid
- Math
- Language API knowledge
- Optimization
array as they are easy to iterate through and convert data types into.
assign a parameter for the number to start from utilize a for loop to iterate through starting from parameter number in the loop add a check for palindrome if the check returns true, return number
https://replit.com/@ConnorAndersonL/DiligentUnnaturalBusiness#index.js