Fix type annotations for integer_partition.py #4052 (#4689)

This commit is contained in:
Aswin Murali 2021-08-30 13:36:59 +05:30 committed by GitHub
parent 8e5c3536c7
commit 3acca3d1d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,8 +6,8 @@ into k parts. These two facts together are used for this algorithm.
"""
def partition(m):
memo = [[0 for _ in range(m)] for _ in range(m + 1)]
def partition(m: int) -> int:
memo: list[list[int]] = [[0 for _ in range(m)] for _ in range(m + 1)]
for i in range(m + 1):
memo[i][0] = 1