AtDrive Group interview question

puzzle problem