HGV Drivers UK interview question

Two pointer question from litcode