Let the speed of the stream be x km/hr
Speed of the boat in still water =18 km/hr
Speed of the boat in upstream =(18−x) km/hr
Speed of the boat in downstream =(18+x) km/hr
Distance between the places is 24 km.
Time to travel in upstream d18–x hr
Time to travel in downstream d18+x hr
Difference between timings =1 hr
Time of upstream journey = Time of downstream journey +1 hr
Therefore, 2418–x=2418+x+1
⇒2418–x−2418+x=1
⇒432+24x−432+24x(18−x)(18+x)=1
⇒48x=324–x2
⇒x2+48x−324=0
⇒x2+54x−6x−324=0
⇒x(x+54)−6(x+54)=0
⇒(x+54)(x−6)=0
So, x=−54 or 6 (speed of the stream cannot be negative)
Therefore, speed of stream is 6 km/hr.