Samsung Research America Interview Question

Coding