Typing fixes
This commit is contained in:
@@ -45,7 +45,7 @@ def palindrome_partitions(s: str) -> int:
|
||||
def main():
|
||||
n: int = int(input())
|
||||
|
||||
for i in range(0, n):
|
||||
for _ in range(0, n):
|
||||
in_str = input().strip()
|
||||
print(palindrome_partitions(in_str))
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ def palindrome_partitions(s: str) -> int:
|
||||
def main():
|
||||
n: int = int(input())
|
||||
|
||||
for i in range(0, n):
|
||||
for _ in range(0, n):
|
||||
in_str = input().strip()
|
||||
print(palindrome_partitions(in_str))
|
||||
|
||||
|
||||
@@ -8,10 +8,14 @@ Honor Code and Acknowledgments:
|
||||
Comments here on your code and submission.
|
||||
"""
|
||||
|
||||
import typing
|
||||
|
||||
import numpy as np
|
||||
|
||||
type SquareGrid = np.ndarray[tuple[int, int], np.dtype[np.int64]]
|
||||
|
||||
def tile(grid: np.ndarray, hole: tuple[int, int]) -> None:
|
||||
|
||||
def tile(grid: SquareGrid, hole: tuple[int, int]) -> None:
|
||||
|
||||
tile_index = 0
|
||||
grid[hole] = -1
|
||||
@@ -61,12 +65,13 @@ def main():
|
||||
n: int = int(input())
|
||||
x, y = map(int, input().split())
|
||||
|
||||
grid: np.ndarray = np.zeros((2**n, 2**n), dtype=int)
|
||||
grid: SquareGrid = np.zeros((2**n, 2**n), dtype=np.int64)
|
||||
|
||||
tile(grid, (x, y))
|
||||
|
||||
for row in grid:
|
||||
print(" ".join(map(lambda x: f"{x:02d}", row)))
|
||||
row_list = typing.cast(list[int], row.tolist())
|
||||
print(" ".join(map(lambda x: f"{x:02d}", row_list)))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user