6 kyu

Numerical Palindrome #3

283 of 809kkavita92

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 a given number num, write a function which returns the number of numerical palindromes within each number. For this kata, single digit numbers will NOT be considered numerical palindromes.

Return "Not valid" if the input is not an integer or is less than 0.

palindrome(5) => 0
palindrome(1221) => 2 
palindrome(141221001) => 5  
palindrome(1294) => 0
palindrome("1221") => "Not valid"

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:

CreatedApr 1, 2017
PublishedApr 1, 2017
Warriors Trained1345
Total Skips59
Total Code Submissions2883
Total Times Completed809
JavaScript Completions283
Ruby Completions68
Python Completions415
PHP Completions69
Haskell Completions23
COBOL Completions5
Total Stars28
% of votes with a positive feedback rating94% of 232
Total "Very Satisfied" Votes204
Total "Somewhat Satisfied" Votes26
Total "Not Satisfied" Votes2
Total Rank Assessments11
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • kkavita92 Avatar
  • fenring76 Avatar
  • anter69 Avatar
  • myjinxin2015 Avatar
  • donaldsebleung Avatar
  • adrian.eyre Avatar
  • Voile Avatar
  • cliffstamp Avatar
  • akar-0 Avatar
  • dfhwze Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad