|
i got everything correct excepts for 7.1, because i didn't check for empty nodes cases, i thought the graph was not gonna change, like when they give us a cache, they are not suppose to change that. do you think a person with this stupid errors can be a professional programmer? or a prof in any field? |
|
Aushin was correct, your code returns ['g','g'] instead of ['g']: output = [node] + graph[node] resolves to: output = ['g'] + ['g'] edit: added missing quotation marks edit2: There's also a second situation in which case your code will not return the correct result for an input like: because the first element will be checked when only ['a','b'] are in your output list, and it will not add 'd' as a result. this is a bit tricky to test for, because since dictionaries are hash tables, the order of the entries might not actually be the one that you typed in, but it works to show the point with the input above. |
|
This doesn't sound right, @maiza , There was a question in the forum that Peter answered that they would not be testing for the case of an empty node. Check it out: |
this is my code, maybe you can tell me what is wrong. |
What input does it say you failed on?