1
2
3
4
5
6
7
8
9
|
class Solution:
def kthDistinct(self, arr: List[str], k: int) -> str:
kCheck=0
ans=''
for i in range(len(arr)):
if arr.count(arr[i])==1:
kCheck+=1
if kCheck==k: ans=arr[i]; break
return ans
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 2032. Two Out of Three (0) | 2022.03.21 |
---|---|
leetcode 1880. Check if Word Equals Summation of Two Words (0) | 2022.03.21 |
leetcode 2057. Smallest Index With Equal Value (0) | 2022.03.21 |
leetcode 2154. Keep Multiplying Found Values by Two (0) | 2022.03.21 |
leetcode 1051. Height Checker (0) | 2022.03.21 |
댓글