Peloton interview question

Easy leetcode object manipulation question