Wiki Elegant

Hard challenges list

Check If the Brick Fits through the Hole

Check If the Brick Fits through the Hole Write the function that takes three dimensions of a brick: height(a), width(b) and depth(c) and returns true if this brick can fit into a hole with the width(w) and height(h). Examples doesBrickFit(1, 1, 1, 1, 1) ➞ true doesBrickFit(1, 2, 1, 1, 1) ➞ true doesBrickFit(1, 2, 2, 1, …

Check If the Brick Fits through the Hole Read More »

Instances of the Fibonacci Sequence

Instances of the Fibonacci Sequence Create a function that takes a number as an argument and returns n instances of the Fibonacci sequence as an array. Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1. So the easy explanation is: The next element is the sum of the two previous elements. If you want …

Instances of the Fibonacci Sequence Read More »