6 kyu
Build a pile of Cubes
24,201 of 89,914g964
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 | 257696 |
Total Skips | 67021 |
Total Code Submissions | 354379 |
Total Times Completed | 89914 |
C# Completions | 5041 |
Java Completions | 9086 |
Ruby Completions | 2476 |
Python Completions | 31944 |
JavaScript Completions | 24201 |
CoffeeScript Completions | 76 |
Haskell Completions | 591 |
Clojure Completions | 158 |
Elixir Completions | 265 |
TypeScript Completions | 1892 |
C++ Completions | 4935 |
PHP Completions | 2293 |
Crystal Completions | 30 |
F# Completions | 112 |
C Completions | 2861 |
Swift Completions | 748 |
Rust Completions | 1439 |
Go Completions | 1918 |
R Completions | 241 |
Shell Completions | 47 |
OCaml Completions | 28 |
Fortran Completions | 38 |
Julia Completions | 94 |
NASM Completions | 36 |
Nim Completions | 26 |
Scala Completions | 277 |
Kotlin Completions | 738 |
Groovy Completions | 24 |
Dart Completions | 438 |
Pascal Completions | 26 |
Raku Completions | 14 |
Perl Completions | 45 |
COBOL Completions | 15 |
Elm Completions | 11 |
D Completions | 10 |
Erlang Completions | 20 |
Prolog Completions | 16 |
Total Stars | 3082 |
% of votes with a positive feedback rating | 86% of 8410 |
Total "Very Satisfied" Votes | 6393 |
Total "Somewhat Satisfied" Votes | 1720 |
Total "Not Satisfied" Votes | 297 |
Total Rank Assessments | 34 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 8 kyu |