6 kyu
Build a pile of Cubes
23,993 of 88,951g964
Description:
Your task is to construct a building which will be a pile of n cubes. The cube at the bottom will have a volume of , the cube above will have volume of and so on until the top which will have a volume of .
You are given the total volume m of the building. Being given m can you find the number n of cubes you will have to build?
The parameter of the function findNb (find_nb, find-nb, findNb, ...)
will be an integer m
and you have to return the integer n such as
if such a n exists or -1 if there is no such n.
Examples:
findNb(1071225) --> 45
findNb(91716553919377) --> -1
Mathematics
Algorithms
Similar Kata:
Stats:
Created | Jun 30, 2015 |
Published | Jun 30, 2015 |
Warriors Trained | 255855 |
Total Skips | 66770 |
Total Code Submissions | 351843 |
Total Times Completed | 88951 |
C# Completions | 4999 |
Java Completions | 9014 |
Ruby Completions | 2468 |
Python Completions | 31550 |
JavaScript Completions | 23993 |
CoffeeScript Completions | 73 |
Haskell Completions | 586 |
Clojure Completions | 157 |
Elixir Completions | 263 |
TypeScript Completions | 1862 |
C++ Completions | 4847 |
PHP Completions | 2278 |
Crystal Completions | 28 |
F# Completions | 110 |
C Completions | 2828 |
Swift Completions | 735 |
Rust Completions | 1414 |
Go Completions | 1883 |
R Completions | 238 |
Shell Completions | 43 |
OCaml Completions | 27 |
Fortran Completions | 37 |
Julia Completions | 93 |
NASM Completions | 35 |
Nim Completions | 25 |
Scala Completions | 270 |
Kotlin Completions | 725 |
Groovy Completions | 23 |
Dart Completions | 422 |
Pascal Completions | 25 |
Raku Completions | 13 |
Perl Completions | 42 |
COBOL Completions | 12 |
Elm Completions | 10 |
D Completions | 9 |
Erlang Completions | 18 |
Prolog Completions | 15 |
Total Stars | 3064 |
% of votes with a positive feedback rating | 86% of 8379 |
Total "Very Satisfied" Votes | 6367 |
Total "Somewhat Satisfied" Votes | 1716 |
Total "Not Satisfied" Votes | 296 |
Total Rank Assessments | 34 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 8 kyu |