Morgan Stanley interview question

An easy Leetcode coding question