7 kyu

Sum of squares less than some number

124 of 1,848wichu

Description:

Write a function getNumberOfSquares (C, F#, Haskell) / get_number_of_squares (Python, Ruby) that will return how many integer (starting from 1, 2...) numbers raised to power of 2 and then summed up are less than some number given as a parameter.

E.g 1: For n = 6 result should be 2 because 1^2 + 2^2 = 1 + 4 = 5 and 5 < 6 E.g 2: For n = 15 result should be 3 because 1^2 + 2^2 + 3^2 = 1 + 4 + 9 = 14 and 14 < 15

Fundamentals

Stats:

CreatedAug 19, 2016
PublishedAug 19, 2016
Warriors Trained3050
Total Skips87
Total Code Submissions5364
Total Times Completed1848
Haskell Completions124
Clojure Completions65
Python Completions1011
F# Completions58
C Completions283
Ruby Completions48
COBOL Completions7
JavaScript Completions350
Julia Completions8
Prolog Completions5
Total Stars24
% of votes with a positive feedback rating89% of 355
Total "Very Satisfied" Votes293
Total "Somewhat Satisfied" Votes48
Total "Not Satisfied" Votes14
Total Rank Assessments12
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • wichu Avatar
  • Unnamed Avatar
  • suic Avatar
  • AcesOfGlory Avatar
  • JohanWiltink Avatar
  • nomennescio Avatar
  • Voile Avatar
  • rowcased Avatar
  • stellartux Avatar
  • user8436785 Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
Ad