34
Comments
  • 9
    This makes me irrationally angry lol
  • 3
    It's not wrong.....
  • 1
    @M1sf3t ya, but those crazy folk and their big noisy contraptions, what ever happened to the time of just walking to ma's cave.
  • 6
    ffs, just use a boolean[] !!! Lookups by index are soooo much faster than all the if-elses. And much more readable!

    /s
  • 1
    Omg this is just horrible
  • 1
    I wanna know where they stopped...
  • 1
    So, using the LSB of the number as inverted boolean value was too complex?
  • 4
    I saw this kind of code (up to 100) in production for a fortune 500 company, and wasn't authorized to remove it...
  • 2
    I prefer my solution. Very efficient !
    @highlight
  • 4
  • 2
    That's horrible! 0 is missing!
  • 3
    @rooter

    isOdd in JS + regex, because both languages represent the apex of memeability.

    isOdd = (n) => /(?<!.).(..)*(?!.)/.test('penis'.repeat(n))

    Also, added bonus: Odd numbers will be found in O(n), while even numbers will take O(2^n)!
  • 4
    @rooter depends on the context. On the bus window? Yes, it's odd. In the wallet? Definitely yes. In your pants? Depends, whose penis is it..

    So yeah, I guess a penis is mostly odd
  • 2
    @rooter (?<!.).(..)*(?!.) will just match any string with an odd length. It would also match titties, but not boob or dick.

    1 penis has length 5 (really, just measure it! You can use "penis".length), so that's odd

    2 penises have length 10, so that's even

    3 penises have length 15, so that's odd

    So as long as the penises together have an odd length, it's a match.
  • 2
    Everyday we stray further away from the light
  • 1
    @dontknowshit The joke, probably. But the screenshot is actually 6 days old and really originally made by Kat Maddox a.k.a. Katerina Borodina-Petrovic.

    Of course the screenie is a troll, because she's a skilled Australian hacker with a CS Bachelor from the University of New South Wales.
  • 2
    return !(number%2)
  • 1
    Aren't else it's expensive?
  • 0
    @bittersweet Shes actually sound more impressive / legit if you oeft out the Bachelors.

    Grads are never as good as they say.
Add Comment