Skip to content

Commit 510af8f

Browse files
committed
feat: add more problems
1 parent 8246984 commit 510af8f

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

leetcode/linked_list_cycle/playground.ipynb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,8 @@
1212
"\n",
1313
"sys.path.append(os.path.join(os.getcwd(), \"..\"))\n",
1414
"\n",
15-
"# Import create_cycle_list from tests\n",
1615
"from linked_list_cycle.tests import TestLinkedListCycle\n",
17-
"from solution import Solution\n",
18-
"\n",
19-
"from leetcode_py import ListNode\n",
20-
"\n",
21-
"create_cycle_list = TestLinkedListCycle.create_cycle_list"
16+
"from solution import Solution"
2217
]
2318
},
2419
{
@@ -52,14 +47,14 @@
5247
}
5348
],
5449
"source": [
55-
"head = TestLinkedListCycle.create_cycle_list(values, pos)\n",
50+
"head = TestLinkedListCycle().create_cycle_list(values, pos)\n",
5651
"result = Solution().has_cycle(head)\n",
5752
"result"
5853
]
5954
},
6055
{
6156
"cell_type": "code",
62-
"execution_count": 7,
57+
"execution_count": 4,
6358
"id": "test",
6459
"metadata": {},
6560
"outputs": [],

leetcode/linked_list_cycle/tests.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ class TestLinkedListCycle:
1010
def setup_method(self):
1111
self.solution = Solution()
1212

13-
@staticmethod
14-
def create_cycle_list(values: list[int], pos: int) -> ListNode[int] | None:
13+
def create_cycle_list(self, values: list[int], pos: int) -> ListNode[int] | None:
1514
if not values:
1615
return None
1716

0 commit comments

Comments
 (0)