Ad
  • Custom User Avatar

    Never thought of using the modulo operator that way! Excellent.

  • Custom User Avatar

    Thanks for expanding it! I'm still learning as well and there are a few things here I didn't notice myself.

  • Custom User Avatar

    This one caught my eye--it's a pretty interesting approach to the problem! There are a lot of layers there for sure :) I'm honestly pretty new to programming myself, but it seems like your approach may be a bit of a roundabout way, though--there are a lot of simpler techniques you could use to get the job done.

    A few of the things I noticed:

    On the macro level:

    • The solution really doesn't need to have this many components. You should be able to do this with just one for loop and one if statement. A lot of this code could be easily replaced by something a lot shorter or just removed altogether.

    On the micro level:

    • The names for your lists and lengths are short, which is nice, but kind of confusing--clearer naming would help!
    • You really don't need the lengths of lists a and b at all; you can do what you need without specifying those
    • You seem to have two return statements--you could cut that down to one :)

    Great job getting the code to work though! A solution is a solution :)