Dashboard Temp Share Shortlinks Frames API

HTMLify

index.py
Views: 4 | Author: devwajahat
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
class Solution:
    def smallerNumbersThanCurrent(self, nums: list[int]) -> list[int]:
        
        ans = []
        
        for i in nums:
            count = 0
            for j in nums:

                if j < i:
                 count += 1
               
            ans.append(count)
        
        return ans