Ad
  • Custom User Avatar

    ok, well i can just be a bit lazier.
    exec(__import__("marshal").loads(__import__("codecs").decode("63000000000000000000000000000000000200000040000000730c00000065006400830101006401530029027a476f72206a757374206265206c617a69657220616e6420637265617465206d79206f776e2070726f6772616d207468617420646f65732062797465636f646528696d206c617a79294e2901da057072696e74a90072010000007201000000fa083c737472696e673eda083c6d6f64756c653e0100000073020000000c01","hex")))

    p.s. this is for logging to console

  • Custom User Avatar

    sth i made on my own (i dont think ill reveal it? if youre interested u can read up here and try to implement one yourself, or perform it by hand)

  • Custom User Avatar

    what program

  • Custom User Avatar

    This is actually pretty possible and would be very easy to do by hand, but it would take absolutely forever.

  • Custom User Avatar

    This is wild. Well done!

  • Custom User Avatar

    yes i used a program to convert it (i wrote the program myself tho)

    heres the original code

    import string;ceasar=lambda s,n: "".join([c for c in map(lambda c: (string.ascii_lowercase[n:] + string.ascii_lowercase[:n])[ord(c)-97] if c in (string.ascii_lowercase[n:] + string.ascii_lowercase[:n]) or c in (string.ascii_uppercase[n:] + string.ascii_uppercase[:n]) and c.islower() else (string.ascii_uppercase[n:] + string.ascii_uppercase[:n])[ord(c)-65] if c in (string.ascii_lowercase[n:] + string.ascii_lowercase[:n]) or c in (string.ascii_uppercase[n:] + string.ascii_uppercase[:n]) and c.isupper() else c, s)])
    
  • Custom User Avatar

    There must be a program you use to convert the solution into this one-liner, right? If you wrote this all by hand, where on earth do you learn how to do this?

  • Custom User Avatar
  • Custom User Avatar

    i mean, they didnt use a integer overflow approach.
    Maybe you saved me!

  • Custom User Avatar

    Well, at least now you know what to expect. Good luck next time!

  • Custom User Avatar

    Thats true. Good point.
    but this kata may say bye bye... I found a kata similar to this.

  • Custom User Avatar

    In case the index goes out of range, for example, if we have ["one", "two", "three"] but the index is 3 (4th character), the ones with insufficient characters will have their last character taken instead of that index.

    With negative overflow the tests actually expect us to take the first character, and not the last one. This is very reasonable, but should be clarified.

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    Hi, first time making a kata

    I realised importing random was actually possible, thank you so much for ur help!
    Just joined the discord to get more tips

  • Loading more items...