Skip to content

Commit e70844a

Browse files
authored
Added tests 4, 5
1 parent 720aab2 commit e70844a

File tree

29 files changed

+107
-81
lines changed

29 files changed

+107
-81
lines changed

README.md

Lines changed: 78 additions & 78 deletions
Large diffs are not rendered by default.

src/main/python/g0001_0100/s0001_two_sum/Solution0001_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import unittest
22
from Solution0001 import Solution
33

4-
class TestSolution(unittest.TestCase):
4+
class SolutionTest(unittest.TestCase):
55
def test_twoSum(self):
66
self.assertEqual(Solution().twoSum([2, 7, 11, 15], 9), [0, 1])
77

src/main/python/g0001_0100/s0002_add_two_numbers/Solution0002_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def linked_list_to_str(node):
1818
node = node.next
1919
return ', '.join(vals)
2020

21-
class TestSolution(unittest.TestCase):
21+
class SolutionTest(unittest.TestCase):
2222
def test_addTwoNumbers(self):
2323
listNode1 = construct_linked_list([2, 4, 3])
2424
listNode2 = construct_linked_list([5, 6, 4])

src/main/python/g0001_0100/s0003_longest_substring_without_repeating_characters/Solution0003_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import unittest
22
from Solution0003 import Solution
33

4-
class TestSolution(unittest.TestCase):
4+
class SolutionTest(unittest.TestCase):
55
def test_lengthOfLongestSubstring(self):
66
self.assertEqual(Solution().lengthOfLongestSubstring("abcabcbb"), 3)
77

src/main/python/g0001_0100/s0004_median_of_two_sorted_arrays/Solution.py renamed to src/main/python/g0001_0100/s0004_median_of_two_sorted_arrays/Solution0004.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# #Top_Interview_150_Binary_Search #Big_O_Time_O(log(min(N,M)))_Space_O(1)
33
# #AI_can_be_used_to_solve_the_task #2025_07_22_Time_3_ms_(51.31%)_Space_18.28_MB_(18.81%)
44

5+
from typing import List
6+
57
class Solution:
68
def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float:
79
if len(nums2) < len(nums1):
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import unittest
2+
from Solution0004 import Solution
3+
4+
class SolutionTest(unittest.TestCase):
5+
def test_findMedianSortedArrays(self):
6+
self.assertEqual(
7+
Solution().findMedianSortedArrays([1, 3], [2]),
8+
2.0
9+
)
10+
11+
def test_findMedianSortedArrays2(self):
12+
self.assertEqual(
13+
Solution().findMedianSortedArrays([1, 2], [3, 4]),
14+
2.5
15+
)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import unittest
2+
from Solution0005 import Solution
3+
4+
class SolutionTest(unittest.TestCase):
5+
def test_longestPalindrome(self):
6+
self.assertEqual(Solution().longestPalindrome("babad"), "bab")
7+
8+
def test_longestPalindrome2(self):
9+
self.assertEqual(Solution().longestPalindrome("cbbd"), "bb")

0 commit comments

Comments
 (0)