5 kyu
Palindrome integer composition
128 of 329KenKamau
Description:
The palindromic number 595
is interesting because it can be written as the sum of consecutive squares: 6^2 + 7^2 + 8^2 + 9^2 + 10^2 + 11^2 + 12^2 = 595
.
There are exactly eleven palindromes below one-thousand that can be written as consecutive square sums. Note that 1 = 0^2 + 1^2
has not been included as this problem is concerned with the squares of positive integers.
Given an input n
, find the count of all the numbers less than n
that are both palindromic and can be written as the sum of consecutive squares.
For instance: values(1000) = 11
. See test examples for more cases.
Good luck!
This Kata is borrowed from Project Euler #125
If you like this Kata, please try:
Performance
Algorithms
Similar Kata:
Stats:
Created | Aug 21, 2017 |
Published | Aug 21, 2017 |
Warriors Trained | 1728 |
Total Skips | 123 |
Total Code Submissions | 3448 |
Total Times Completed | 329 |
Python Completions | 128 |
JavaScript Completions | 59 |
Ruby Completions | 15 |
C++ Completions | 52 |
C# Completions | 27 |
Java Completions | 55 |
Go Completions | 19 |
Total Stars | 47 |
% of votes with a positive feedback rating | 87% of 90 |
Total "Very Satisfied" Votes | 69 |
Total "Somewhat Satisfied" Votes | 18 |
Total "Not Satisfied" Votes | 3 |
Total Rank Assessments | 4 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 6 kyu |