Ad
  • Default User Avatar

    Perhaps because it doesn't use itertools.product? Zen of Python says "There should be one-- and preferably only one --obvious way to do it." Many people take this to mean that you should use built-ins where available, instead of reinventing them.

  • Custom User Avatar

    Nice use of recursive algorithms! 👏

    I'm curious why this isn't best-practice?

    Compared to the current best-practice solution, this solution is self documenting and requires no prior knowledge of the itertools.product library function.

  • Custom User Avatar

    Hi Ananyats, it would have been better if you asked a specific question or comment to complement your code. If you just wanted to show us your code, no need, we can already see it in the "solutions" page.