Last active
March 5, 2020 15:43
-
-
Save m80126colin/d0eac9140bfe607b9c1dd8a418d47ba4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import product | |
from functools import reduce | |
class Number(): | |
def __init__(self): | |
self.num = 0 | |
def succ(self): | |
self.num += 1 | |
return self | |
def toInt(self): | |
return self.num | |
res = reduce(lambda x, _: x.succ(), product(range(6 + 1), range(4 + 1), range(10)), Number()) | |
print(res.toInt()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment