def solution() -> Solution: return Solution()
def test_is_symmetric(input_value: List[int], expected_result: List[int], solution: Solution) -> None: original = create_list_node(input_value) assert convert_node_list_to_list( solution.reverseList(original)) == expected_result
def test_is_valid(input_value: List[int], expected_result: int, solution: Solution) -> None: assert solution.rob(input_value) == expected_result
def test_is_symmetric(input_value: List[Optional[int]], expected_result: bool, solution: Solution) -> None: tree = create_tree(input_value) assert solution.isSymmetric(tree) is expected_result
def test_is_symmetric(input_value: List[int], expected_result: int, solution: Solution) -> None: assert solution.maxProfit(input_value) == expected_result
def test_basic(self): s = Solution() self.assertEqual(3, s.romanToInt("III"))
def test_lviii(self): s = Solution() self.assertEqual(58, s.romanToInt("LVIII"))
def test_iv(self): s = Solution() self.assertEqual(4, s.romanToInt("IV"))
def test_merge_trees(input_value: Tuple[List[Optional[int]]], expected_result: List[Optional[int]], solution: Solution) -> None: t1, t2 = (create_tree(val) for val in input_value) assert repr(solution.mergeTrees(t1, t2)) == repr(create_tree(expected_result))
def test_max_depth(input_value: List[Optional[int]], expected_result: int, solution: Solution) -> None: tree = create_tree(input_value) assert solution.maxDepth(tree) == expected_result