Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
igoros
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
igoros
14y ago
Nice approach! It's O(1) to find a candidate solution, but of course it will still be O(N) to verify that the solution really works.
2.
▲
by
igoros
14y ago
Here is an O(N) functional solution in C# LINQ: http://pastebin.com/fvdmQBFC Making the solution "functional" was by far the most time-consuming part of the exercise.
3.
▲
by
igoros
16y ago
Answer in rot13: Gur grpuavdhr vf pnyyrq "qlanzvp cebtenzzvat". Naq, guvf cnegvphyne ceboyrz vf pnyyrq gur "pbva punatr ceboyrz".
4.
▲
by
igoros
16y ago
... a little too obvious? Funny how all those accounts saying nice things about hyperpublic have been created within the last hour.
5.
▲
by
igoros
16y ago
I got their answer. Note that there is a wrong "solution" to this problem that looks like it might be right. It is a very standard problem, by the way. Most books on algorithms will have the solution.
6.
▲
by
igoros
16y ago
Any piece of information can be abused. The article simply explains what branch prediction is and why CPUs implement it. No part of the article advocates that you attempt to optimize your code to exploit branch prediction. In fact, the conc