728x90
https://leetcode.com/problems/how-many-numbers-are-smaller-than-the-current-number
class Solution:
def smallerNumbersThanCurrent(self, nums: List[int]) -> List[int]:
result = []
for i in nums:
count = 0
for j in nums:
if i > j:
count += 1
result.append(count)
return result
728x90
'IT > 코딩테스트' 카테고리의 다른 글
[Leetcode] 1656. Design an Ordered Stream (0) | 2024.02.19 |
---|---|
[Leetcode] 535. Encode and Decode TinyURL (0) | 2024.02.18 |
[Leetcode] 2610. Convert an Array Into a 2D Array With Conditions (0) | 2024.02.08 |
[Leetcode] 1282. Group the People Given the Group Size They Belong To (0) | 2024.02.08 |
[Leetcode] 771. Jewels and Stones (0) | 2024.02.07 |