Samsung Research America interview question

Leetcode easy/medium questions, standard behavioral