Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I know it's a two year old question, but I'll bite, as I wrote a very similar solution (technically, it's two lines, not one).

    In this case, it was a pretty simple problem and the code was initially written on one line. It would have taken more time and effort to deconstruct it into multiple lines. Arguably, if you spread it over as many lines as possible, it would have been harder to read, so you have to decide what stays together on one line and what splits up. That all takes time and mental effort - and it's just another 6kyu kata that I just want to tick off.

    Other times, I take an initial long, rambling, solution and cram it onto one line, often simplifying it in the process. In those cases, I am just having fun - trying to make it concise and elegant. If it was production code that another programmer would have to work with in the future, I might still do this - in order to see what can be simplified - but then I would rewrite it in a clear, unambiguous and self-documenting manner (which would usually necessitate it being multiple lines).

  • Custom User Avatar
  • Custom User Avatar

    Not sure if you're trolling or not but, you know you could just scroll through it by having your pointer outside the solution box.

  • Custom User Avatar

    Not at all.. yours includes and involves extra unnecessary steps. It's needlessly more confusing in an attempt at needless universality.

  • Custom User Avatar

    #11b33/3q9:0z:vV

    i can see the appeal of writing code like neutron star material

    your code is very concise and elegannt

  • Custom User Avatar

    In Python can you have a list where some items in it are lists are some items are numbers?

    If so then my solution won't work.

  • Custom User Avatar

    Please use spoiler flag next time.

  • Custom User Avatar

    Nothing is broken, your code is wrong, you're changing the order of the operands.