Hitachi Hiring Challenge | Online Assessment Question | Off-Campus (2023)

Hitachi · Question · Posted Jun 2026

Minimum Cost to Move Chips to The Same Position Problem Statement There are n chips placed at different positions on a number line. Moving a chip by 2 positions costs 0. Moving a chip by 1 position costs 1. Return the minimum cost required to move all chips to the same position. Example Input position = [2,2,2,3,3] Output 2 Test Cases Test Case 1 Input position = [2,4,6,8] Output 0 Test Case 2 Input position = [1,2,3] Output 1

The full answer & interview discussion are available to premium members.

Log in Create a free account