Skip to content

Commit d3b046b

Browse files
authored
Improved task 1
1 parent a879559 commit d3b046b

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# #Easy #Top_100_Liked_Questions #Top_Interview_Questions #Array #Hash_Table
22
# #Data_Structure_I_Day_2_Array #Level_1_Day_13_Hashmap #Udemy_Arrays #Top_Interview_150_Hashmap
33
# #Big_O_Time_O(n)_Space_O(n) #AI_can_be_used_to_solve_the_task
4-
# #2024_06_06_Time_62_ms_(53.52%)_Space_17.8_MB_(37.79%)
4+
# #2025_07_06_Time_0_ms_(100.00%)_Space_19.05_MB_(23.85%)
55

66
from typing import List
77

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

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22
from Solution import Solution
33

44
class TestSolution(unittest.TestCase):
5-
def setUp(self):
6-
self.sol = Solution()
5+
def test_twoSum(self):
6+
self.assertEqual(Solution().twoSum([2, 7, 11, 15], 9), [0, 1])
77

8-
def test_two_sum(self):
9-
self.assertEqual(self.sol.twoSum([2, 7, 11, 15], 9), [0, 1])
8+
def test_twoSum2(self):
9+
self.assertEqual(Solution().twoSum([3, 2, 4], 6), [1, 2])
1010

11-
def test_two_sum2(self):
12-
self.assertEqual(self.sol.twoSum([3, 2, 4], 6), [1, 2])
11+
def test_twoSum3(self):
12+
self.assertEqual(Solution().twoSum([3, 3], 6), [0, 1])
1313

14-
def test_two_sum3(self):
15-
self.assertEqual(self.sol.twoSum([3, 3], 6), [0, 1])
16-
17-
def test_two_sum4(self):
18-
self.assertEqual(self.sol.twoSum([3, 3], 7), [-1, -1])
14+
def test_twoSum4(self):
15+
self.assertEqual(Solution().twoSum([3, 3], 7), [-1, -1])

0 commit comments

Comments
 (0)