Hi there!
Distance and displacement are different.
Distance is WITHOUT direction (scalar quantity)
Displacement TAKES INTO ACCOUNT direction (vector quantity), and is RELATIVE to the initial point.
DISTANCE:
Add up each segment's position:
0 - 2 sec: 0 m
2 - 5 sec: 10 - 4 = 6 m
5 - 6 sec: 0 m
6 - 8 sec: 10 - 2 = 8 m
8 - 9 sec: 0 m
9 - 12 sec: 5 - 2 = 3 m
Add up:
6 + 8 + 3 = 17 m
DISPLACEMENT:
To find displacement, simply look at the position at the final point (t = 12 sec) and compare to the initial position:
At t = 12: Position = 5 m
At t = 0: Position = 4 m
5 - 4 = 1 m