Skip to content

Commit eeefe9a

Browse files
committed
chore(array) : rename files
1 parent 9ae25e6 commit eeefe9a

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
# URL : https://leetcode.com/problems/k-diff-pairs-in-an-array/
55
###############################################################
66
from collections import Counter
7+
from typing import List
78

89

910
class KDiffPairs:
1011
# runtime -> 93.76%, memory -> 8.49%
11-
def findPairs(self, nums: [int], k: int) -> int:
12+
def findPairs(self, nums: List[int], k: int) -> int:
1213
if k > 0:
1314
"""create a list where each element is k-distance
1415
from corresponding element in the input list
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
# URL : https://leetcode.com/problems/kth-largest-element-in-an-array/
55
######################################################################
66
from heapq import heapify, heappop
7+
from typing import List
78

89

910
class KLargestElement:
10-
def find_bubble_sort(self, nums: [int], k: int) -> int:
11+
def find_bubble_sort(self, nums: List[int], k: int) -> int:
1112
""" using bubble sort
1213
complexity : O(nk)
1314
-> outer loop `k` times, inner loop `n` times
@@ -34,7 +35,7 @@ def find_bubble_sort(self, nums: [int], k: int) -> int:
3435
""" return kth largest element from the end """
3536
return nums[len(nums) - k]
3637

37-
def find_heap(self, nums: [int], k: int) -> int:
38+
def find_heap(self, nums: List[int], k: int) -> int:
3839
""" using heap
3940
complexity : O(n + k log n)
4041
-> O(n) for creating the heap
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from simple_array.k_diff_pairs import KDiffPairs
1+
from simple_array.e_k_diff_pairs import KDiffPairs
22

33

44
class TestKDiffPairs:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from simple_array.kth_largest import KLargestElement
1+
from simple_array.m_kth_largest import KLargestElement
22

33

44
class TestKLargestElement:

0 commit comments

Comments
 (0)