Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
417 B
1
Indexable
Never
def F(s, f, n):
    if s > f or n > 7:
        return 0
    if s == f :
        return 1
    if s < f and n < 7:
        return F(s + 1, f, n + 1) + F(s + 2, f, n + 1) + F(s + 3, f, n + 1)
    return 0
print(F(3, 22, 0))


def F(s, f, n):
    if s > f:
        return 0
    if s == f :
        return n == 7
    if s < f:
        return F(s + 1, f, n + 1) + F(s + 2, f, n + 1) + F(s + 3, f, n + 1)

print(F(3, 22, 0))