Type hint for a dict gives TypeError: 'type' object is not subscriptable
If you're using python 3.8, then perhaps you need to do some import
from typing import Dict
memo: Dict[int, int] = {0: 0, 1: 1}
If you're using python 3.9 and above, you should be good. If you're going to do some type hinting.
memo: dict[int, int] = {0: 0, 1: 1}
Comments