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 #1
Numerical Palindrome #1.5
Numerical Palindrome #2
Numerical Palindrome #3
Numerical Palindrome #3.5
Numerical Palindrome #4
Numerical Palindrome #5
Fundamentals

Stats:

CreatedMar 31, 2017
PublishedMar 31, 2017
Warriors Trained2049
Total Skips57
Total Code Submissions7039
Total Times Completed1042
JavaScript Completions411
Ruby Completions91
Python Completions499
PHP Completions75
Crystal Completions9
Haskell Completions29
COBOL Completions4
Total Stars46
% of votes with a positive feedback rating93% of 297
Total "Very Satisfied" Votes260
Total "Somewhat Satisfied" Votes33
Total "Not Satisfied" Votes4
Total Rank Assessments10
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • kkavita92 Avatar
  • fenring76 Avatar
  • anter69 Avatar
  • 10XL Avatar
  • donaldsebleung Avatar
  • adrian.eyre Avatar
  • Blind4Basics Avatar
  • Voile Avatar
  • cliffstamp Avatar
  • akar-0 Avatar
  • dfhwze Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad