Ad
  • Custom User Avatar

    Have you noticed that the kata is available in 5 languages? Only Python has numpy, how can the others do? Computing a matrix determinant or solving a linear equation isn't something magical, it's just math. You have to do it by yourself to solve this kata, that's it. And don't expect someone to give you the recipe in discussion.

  • Custom User Avatar

    Calculation of a determinant is perfectly in scope of a 4 kyu task :)

  • Custom User Avatar

    It copies it from the sentence in the second-to-last (non-braces) line.

  • Custom User Avatar

    Hi @Alterra Laniakea - the reason is that when you call set(word) the elements will not always appear in the same predictable order.

    To see this for yourself, after your line ... set(word): add print(i) then run your code 10 times on the same input on your computer locally.

    For example, with the test case you are having problems with you will get different orders of symbols like:

    , @, ( then maybe @, , ( then maybe , (, @ etc.

    Depending on which order gets generated by set() your logic will work differently afterwards. For example, work through the order , (, @ and see if you can understand why your code produces )))(. Whereas for the order , @, ( it produces ))))