← Back to challenges

Number of Stickers

PythonMediummathalgebra

Instructions

Given a Rubik's Cube with a side length of n, return the number of individual stickers that are needed to cover the whole cube.

Pictures of Rubik's Cubes

  • The Rubik's cube of side length 1 has 6 stickers.
  • The Rubik's cube of side length 2 has 24 stickers.
  • The Rubik's cube of side length 3 has 54 stickers.

Examples

how_many_stickers(1) ➞ 6

how_many_stickers(2) ➞ 24

how_many_stickers(3) ➞ 54

Notes

  • Keep in mind there are six faces to keep track of.
  • Expect only positive whole numbers.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Repeat String