Algorithm · Google · Medium
Requirements Input: an integer list representing piano-key locations, where numbering begins at 1. One hand may start on any location. Determine the number of repositionings needed to play the entire sequence. The hand span is 5 consecutive key locations by default, and one placement covers one fixed contiguous interval of that span. Keys must be played in the supplied order. A sequence of keys forms one group when all its locations fit within one such interval; when the…
Checking your access…