6 kyu
Build a pile of Cubes
31,716 of 89,330g964
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 | 256656 |
Total Skips | 66856 |
Total Code Submissions | 352852 |
Total Times Completed | 89330 |
C# Completions | 5015 |
Java Completions | 9044 |
Ruby Completions | 2472 |
Python Completions | 31716 |
JavaScript Completions | 24072 |
CoffeeScript Completions | 75 |
Haskell Completions | 588 |
Clojure Completions | 158 |
Elixir Completions | 265 |
TypeScript Completions | 1875 |
C++ Completions | 4886 |
PHP Completions | 2287 |
Crystal Completions | 29 |
F# Completions | 111 |
C Completions | 2837 |
Swift Completions | 742 |
Rust Completions | 1427 |
Go Completions | 1895 |
R Completions | 239 |
Shell Completions | 46 |
OCaml Completions | 28 |
Fortran Completions | 38 |
Julia Completions | 94 |
NASM Completions | 36 |
Nim Completions | 26 |
Scala Completions | 273 |
Kotlin Completions | 729 |
Groovy Completions | 24 |
Dart Completions | 428 |
Pascal Completions | 26 |
Raku Completions | 14 |
Perl Completions | 43 |
COBOL Completions | 14 |
Elm Completions | 11 |
D Completions | 10 |
Erlang Completions | 20 |
Prolog Completions | 16 |
Total Stars | 3071 |
% of votes with a positive feedback rating | 86% of 8392 |
Total "Very Satisfied" Votes | 6377 |
Total "Somewhat Satisfied" Votes | 1718 |
Total "Not Satisfied" Votes | 297 |
Total Rank Assessments | 34 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 8 kyu |