Ad
  • Custom User Avatar

    My solution is the same. But I use static result slice size. It gives me almost 2 times better performance. Example benchmarking for my and your code:
    BenchmarkJosephusDmitryermichev-4 5081414 207 ns/op
    BenchmarkJosephusRobinDeNeef-4 3175298 376 ns/op