Lucid Motors interview question

leetcode, c plus plus basic