Let x be the time taken for the student to reach the school on time
speed=
distance = speed * time
speed = 12km/h
distance =12 ∗(x+7)
distance =12 x+84
Second case
distance=speed∗time
speed = 18km/h
distance=18∗(x−10)
distance=18x−180
Now equate both the expressions as they are describing the same distance
18x - 180 =12x + 84
6x = 264
x = 44 minutes
school starts at 9: am
Regards