Hacker News new | ask | show | jobs
by thaumasiotes 1161 days ago
> To be honest the first solution is literally one line of code.

OK, but every program is literally one line of code. We only put line breaks in to make them easier to read.

The author makes this terrible comment about his "one-liner":

> Most candidates though write a for loop, which is equally acceptable.

He has also written a for loop. Specifically, he's written this for loop:

    for i in range(1, len(s)):
        if inDict(s[:i]) and inDict(s[i:]):
            return True
    return False
1 comments

Yeah, that's the part that tripped me up. Looking down on for-loops immediately after showcasing their for-loop solution!