FWIW, I did manage to spot the bug without executing it, but go isn't a language I've used before so I fired up godbolt to try it out before submitting my solution. This isn't a skill that I'd expect of juniors (that is, most programmers). Sounds like you're quite the skilled programmer, enough so that you're taking your experience for granted. I'd encourage you to be a bit kinder about your expectations -- especially with an unfamiliar algorithm, people have multiple unknowns to resolve -- when we read and comprehend code, we're emulating a program in our heads, and that's a hard thing to do!
And, for crap's sake, don't spoil the puzzle on a post about the puzzle!
That said, as an a collection of advanced puzzles, I'm delighted. You're digging out some really awesome algorithms that I've never seen, and I love it. This algorithm is ridiculously clever and surprisingly effective given its simplicity, speed, and memory efficiency. Keep up the good work; I look forward to more of these.
edit: heh, I just did the radix sort one. Made the same stupid mistake last time I wrote a counting sort, so I knew just what to expect... good times.
And, for crap's sake, don't spoil the puzzle on a post about the puzzle!
That said, as an a collection of advanced puzzles, I'm delighted. You're digging out some really awesome algorithms that I've never seen, and I love it. This algorithm is ridiculously clever and surprisingly effective given its simplicity, speed, and memory efficiency. Keep up the good work; I look forward to more of these.
edit: heh, I just did the radix sort one. Made the same stupid mistake last time I wrote a counting sort, so I knew just what to expect... good times.