Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I don't mind to be picking on other's people code but I think I found a small bug.
If the processes are something like:
[['1','a','c'],['2','a','b'],['3','b','c']]
this solution will return ['2','3'] instead of ['1'] for start='a' and end='c'.
This happens because the if is only checking the last element in the queue. If you change the order of the processes the correct solution emerges. The fix is simple, though, instead of just checking the last item, run a for loop over the whole queue.
Something like this will work (to go right after the while line):
for q in queue:
if q[1] == end:
return q[0]
If there is something wrong with my reasoning, do let me know.
I still think this solution is great, that's why I was trying to understand it and came across this issue :)