7 kyu

Invisible cubes

1,307 of 4,542TheOpti

Description:

Imagine there's a big cube consisting of n3 n^3 small cubes. Calculate, how many small cubes are not visible from outside.

For example, if we have a cube which has 4 cubes in a row, then the function should return 8, because there are 8 cubes inside our cube (2 cubes in each dimension)

For a visual representation: --> https://imgur.com/a/AN8A5DJ

Puzzles

Similar Kata:

More By Author:

Check out these other kata created by TheOpti

Stats:

CreatedOct 1, 2015
PublishedOct 1, 2015
Warriors Trained9220
Total Skips1114
Total Code Submissions13033
Total Times Completed4542
JavaScript Completions1307
C# Completions541
Ruby Completions333
Python Completions1351
Java Completions807
Haskell Completions179
C++ Completions159
C Completions87
COBOL Completions10
Total Stars57
% of votes with a positive feedback rating87% of 549
Total "Very Satisfied" Votes438
Total "Somewhat Satisfied" Votes83
Total "Not Satisfied" Votes28
Ad
Contributors
  • TheOpti Avatar
  • GiacomoSorbi Avatar
  • Jotha Avatar
  • NaMe613 Avatar
  • PanTomekPL Avatar
  • ParanoidUser Avatar
  • kazk Avatar
  • Goncalerta Avatar
  • Voile Avatar
  • rowcased Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • MikChan Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
Ad