Morgan Stanley

1 DSA problems asked in Morgan Stanley coding interviews

1 Easy
0 Medium
0 Hard
​

1 problem

Greedy
1
Minimum Cost to Move Chips to The Same Position
Easy

There are `n` chips, and the `i`th chip sits at `position[i]`. Move all chips to the same position. Moving a chip by 2 (left or right) is free, and moving it by 1 costs 1. Return the minimum cost needed.