• Custom User Avatar

    Well, you can do it in O(n) but even simpler is just to exit early if len(walk) is not 10. Then it doesn't matter how long the list is, you will only ever iterate over it if the length is 10. Therefore, any difference in efficiency will be insignificant.

  • Custom User Avatar

    Not all kata are designed for interview.
    If you expect all solutions to be prod-ready, you are not on the right website.

    Here is a suggestion to learn from this solution: you should ask for explanations politely.
    It may bring you more insights than complaining.

  • Custom User Avatar

    Good point...