Hackerrank Problem – Manasa and Stones

Statement – Manasa is out on a hike with friends. She finds a trail of stones with numbers on them. She starts following the trail and notices that any two consecutive stones’ numbers differ...