This file contains hidden or 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 typing import List, Optional, Tuple | |
| Square = Tuple[int, int] | |
| SIZE = 8 | |
| assert SIZE <= 20, "Too large a size will overflow the stack" | |
| def next_possible_squares(x: int, y: int, squares: List[Square]) -> List[Square]: | |
| """Determine the next possible valid squares based on the current square and the previously visited squares. |
This file contains hidden or 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
| def get_entry_size(entry: Any) -> int: | |
| """Get the approximate size an entry will be in JSON. | |
| Notes: Doesn't check for escaped characters in strings, so the size returned | |
| will essentially always be a lower bound. | |
| :param entry: The entry to get the size of | |
| :returns: A size in bytes | |
| """ |
OlderNewer