Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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]))```


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: