Returns the number of values of nCr, for 1 ≤ n ≤ 100, are greater than one-million >>> solution() 4075
()
| 25 | |
| 26 | |
| 27 | def solution(): |
| 28 | """Returns the number of values of nCr, for 1 ≤ n ≤ 100, are greater than |
| 29 | one-million |
| 30 | |
| 31 | >>> solution() |
| 32 | 4075 |
| 33 | """ |
| 34 | total = 0 |
| 35 | |
| 36 | for i in range(1, 101): |
| 37 | for j in range(1, i + 1): |
| 38 | if combinations(i, j) > 1e6: |
| 39 | total += 1 |
| 40 | return total |
| 41 | |
| 42 | |
| 43 | if __name__ == "__main__": |