Ready to begin
No records have been processed. Start with Next step.

Follow the selected procedure. Change a field, tie rule or weekday and explain why the result changes.
Ready
No records have been processed. Start with Next step.
Predict the next change. Keep track of which list level, field and position convention the procedure uses.
Matches = []
foreach Train in candidatesCallingAt(Source):
i = positionOf(Source, Train.Stops)
j = positionOf(Destination, Train.Stops)
if i >= 0 AND j > i AND departureExistsAt(i):
if requestedWeekday is a departure weekday at Source:
Matches = Matches ++ [Train.Number]The outer loop examines candidate trains; the inner scan examines their station lists. Source must occur before destination in that direction, and the train must depart from the source. Finding both names somewhere in a card is insufficient. A service arriving at its final station cannot carry a passenger onward on the same card.
In the verified subset, 02246 goes Bengaluru to Bhubaneswar: departure 11:00 on Day 1 and arrival 09:50 on Day 2, a duration of 22 h 50 min. It originates Monday, Tuesday, Thursday, Friday and Sunday. The Wednesday option therefore has no match for that query on this service.
Chennai-to-Ahmedabad has no matching direct train in the source discussion and our teaching subset. This is a scoped dataset result, not a claim about present-day rail services or every possible connection. A direct-route match also says nothing about seats, fares or real-time delays.
If a train lists Destination before Source, does it answer the forward query?
No. It is travelling in the wrong order for that trip.
If you board at a Day 2 intermediate station, whose weekday must you check?
The departure weekday at that source station, obtained by shifting the origin weekday by the appropriate journey-day offset.
Does “no direct match in this subset” rule out a trip with a transfer?
No. Direct services and connecting journeys are different search tasks.