News for hackers. Stuff that matters.
Re:Ask HN: What to do about ‘Good at programming Bad at Leet... by maerF0x0 on Friday May 20, 2022 @04:15PM (#31452016)
I've had zero or near zero gotcha string problems in my professional career, which are many of the leetcode problems.

Find the (gotcha) in this string and emit len(gotcha) ... Now do it computationally efficiently (or be able to explain tradeoffs to other resources).

Re:Ask HN: What to do about ‘Good at programming Bad at Leet... by tlb on Sunday May 22, 2022 @06:12PM (#31473323)
String problems are rare, though may come up more in search engine companies.

But manipulating sequences comes up a lot in many contexts. Usually it's sequences of more complex things: instructions, packets, files, polygons. It's hard to assign tests directly on those, because you have to explain the objects themselves first. So it's a reasonable shortcut to test ability to manipulate sequences of characters.

Re:Ask HN: What to do about ‘Good at programming Bad at Leet... by Ancalagon on Friday May 20, 2022 @08:06PM (#31454068)
Don't forget: in 45 min, without bugs
Re:Ask HN: What to do about ‘Good at programming Bad at Leet... by maerF0x0 on Sunday May 22, 2022 @06:06PM (#31473281)
oh and do it in Go* ... Good F'ing Luck .

Go makes normal string operations tricky due to rune being an alias for int32, ranging a string gives []byte indexes ...

https://go.dev/play/p/33jCwNG6Eu6

Re:Ask HN: What to do about ‘Good at programming Bad at Leet... by Tomis02 on Friday May 27, 2022 @07:50AM (#31528435)
It's a bit sucky but you can use the standard library function "utf8.DecodeRuneInString(a)".