Tesla interview question

Regular programming problems