Author Archives: Rajesh
Arrays: Left Rotation
Problem A left rotation operation on an array shifts each of the array’s elements 1 unit to the left. For example, if 2 left rotations are performed on an array [1,2,3,4,5], then the array would become [3,4,5,1,2]. Note that the … Continue reading
Sales by Match
Problem Alex works at a clothing store. There is a large pile of socks that must be paired by color for sale.Given an array of integers representing the color of each sock, determine how many pairs of socks with matching … Continue reading