Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Flights With Exactly One Stop

Given direct flights, list every itinerary origin -> via -> destination made of exactly two flights where the first lands where the second departs. Order by origin, via, destination.

Table schema

Flights(id INT PRIMARY KEY, origin VARCHAR(5), dest VARCHAR(5))

Sample data

id | origin | dest
1 | DEL | BOM
2 | BOM | GOA
3 | DEL | GOA
4 | GOA | BLR

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.