The hikers started at point S. The first hiker went 2 miles east and 1 mile north to point A. The second hiker went 1 mile west and 3 miles south to point B. See the figure below.
A I 1 mile I 1 mile I---------S------------------I I 2 miles I I 3 miles I I I B
Now we need to see how much east and how much north hiker B is from hiker A.
A I 1 mile I 1 mile I---------S------------------I I 2 miles I I I I I 3 miles I I 3 miles I I I I B----------------------------I 3 miles
From point B go 3 miles east, then 3 + 1 = 4 miles north to point B. The distance between the hikers is the hypotenuse of a triangle with legs of lengths 3 and 4.