6 kyu
Numerical Palindrome #2
411 of 1,042kkavita92
Description:
A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward as forward. Examples of numerical palindromes are:
2332
110011
54322345
For this kata, single digit numbers will not be considered numerical palindromes.
For a given number num
, write a function to test if the number contains a numerical palindrome or not and return a boolean (true if it does and false if does not). Return "Not valid" if the input is not an integer or is less than 0.
Note: Palindromes should be found without permutating num
.
palindrome(5) => false
palindrome(1221) => true
palindrome(141221001) => true
palindrome(1215) => true
palindrome(1294) => false
palindrome("109982") => "Not valid"
In Haskell, this returns a Maybe Bool, with Nothing for an input less than zero.
Other Kata in this Series:
Numerical Palindrome #1Numerical Palindrome #1.5
Numerical Palindrome #2
Numerical Palindrome #3
Numerical Palindrome #3.5
Numerical Palindrome #4
Numerical Palindrome #5
Fundamentals
Similar Kata:
Stats:
Created | Mar 31, 2017 |
Published | Mar 31, 2017 |
Warriors Trained | 2049 |
Total Skips | 57 |
Total Code Submissions | 7039 |
Total Times Completed | 1042 |
JavaScript Completions | 411 |
Ruby Completions | 91 |
Python Completions | 499 |
PHP Completions | 75 |
Crystal Completions | 9 |
Haskell Completions | 29 |
COBOL Completions | 4 |
Total Stars | 46 |
% of votes with a positive feedback rating | 93% of 297 |
Total "Very Satisfied" Votes | 260 |
Total "Somewhat Satisfied" Votes | 33 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 10 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |