Comment

Comment by yoshicoder

I wrote some python code which should give the right answer

  def formula(total_qs, terminating):
    total = 1 << (total_qs - len(terminating))
    for i, num in enumerate(terminating):
        total += 1 << (num - i)
    return total

  print(formula(10, [1, 5]))```
parent yoshicoder 2 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton