Ad
  • Custom User Avatar

    Flexing, mostly. It's definitely not in this specific kind of situation that these approaches may become useful. But one has to train before jumping from... let's say... the Eiffel tower, and what better place for this than your garden? x)

    (look at the forks, it's even more flexing ;o )

  • Default User Avatar

    Well, I'm not sure about which part you don't understand, so I'll just explain the "non python" part.

    First of all, note that this solution won't work in your IDE if you run it on a non Linux/BSD/UNIX system.

    Python's prime factorisation utility is in module sympy which is not available in Codewars.
    Oddly enough, GNU Core Utils has one (for obscure historical reasons) and our playground is being run on Ubuntu Linux.

    It's then just a matter of calling this factor utility from python via subprocess module and parsing the result.