Let the velocity of the boat be v km/h and velocity of the current be u km/h.
When the boat goes in still water, its velocity is v=6 km/h.
When the boat goes against the current, its velocity is v-u=(6-u) km/h.
For distance S, time taken in still water to cover the distance = S/6 seconds.
For same distance S, time taken while going against the current = S/(6-u) seconds.
According to given, S/(6-u) = 3*(S/6)
=> 1/(6-u) = 1/2
=> 6-u = 2
=> u=4 km/h.
So, the speed of the current is 4 km/h.