Ad
  • Custom User Avatar

    A solution is a solution

    If we don't look at the fact that this solution is absolutely terrible:

    • saving arrays' length in variables and still calling len inside the loop
    • creating new references to the same arrays, and modifying these references
    • assigning ta = a and re-assigning it again if len(a) > len(b) for no reason
    • checking that arrays are not empty by looking at their length (the only time those array-length variables were used, which makes them even more useless)
    • O(n^3) time complexity because of terrible loops and if's
    • useless return inside if block