HackerRank Counting valley Solution Js

Hi, here is the solution for this HackerRank problem “Gary is an avid hiker. He tracks his hikes meticulously, paying close attention to small details like topography. During his last hike he took exactly n steps. For every step he took, he noted if it was an uphill, U, or a downhill,  D step. Gary’s hikes start and end at … Continue reading HackerRank Counting valley Solution Js