We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I like what you did with if (Array[i] != Array[i+1]), that was a clever way of checking for both uniqueness and that it is non-zero. Mine was similar (in python3), using a list to store the unique lengths.
Cut the sticks
You are viewing a single comment's thread. Return to all comments →
I like what you did with
if (Array[i] != Array[i+1])
, that was a clever way of checking for both uniqueness and that it is non-zero. Mine was similar (in python3), using a list to store the unique lengths.https://www.hackerrank.com/challenges/cut-the-sticks/submissions/code/16760136