Hackerrank – Cut the sticks

Hackerrank – Problem Statement

A description of the problem can be found on Hackerrank.

Solution

Until the sticks array is empty:

  • print the length of sticks array
  • sort the array
  • get the minimum value as first element of the array
  • cut the array filtering only values greater than minimum

I created solution in:

All solutions are also available on my GitHub.

Java

JavaScript

Scala

Ruby

Leave a Reply

Your email address will not be published. Required fields are marked *