How Many Numbers Are Smaller Than the Current Number | Leetcode - 1365
Vložit
- čas přidán 7. 07. 2023
- Whiteboard explanation for How Many Numbers Are Smaller Than the Current Number leetcode 1365.
Join this channel to get access to perks:
/ @algorithmsmadeeasy
Get Discount on GeeksforGeeks courses (practice.geeksforgeeks.org/co...) by using coupon code: ALGOMADEASY
To support us you can donate
UPI: algorithmsmadeeasy@icici
Check out our other popular playlists:
Questions you might like:
✅✅✅[ Tree Data Structure] : • Tree Data Structure
✅✅✅[ Graphs Data Structure] : • Graph Data Structure
✅✅✅[ February Leetcoding Challenge] : • February Leetcoding Ch...
✅✅✅[ January Leetcoding Challenge] : • January Leetcoding Cha...
✅✅✅[ February Leetcoding Challenge] : • February Leetcoding Ch...
✅✅✅[ March Leetcoding Challenge] : • March Leetcoding Chall...
✅✅✅[ December Leetcoding Challenge] : • December Leetcoding Ch...
✅✅✅[ November Leetcoding Challenge] : • November Leetcoding Ch...
✅✅✅[ August Leetcoding Challenge] : • August LeetCoding Chal...
✅✅✅[ July Leetcoding challenges] : • July LeetCoding Challe...
✅✅✅[ June Leetcoding challenges] : czcams.com/users/playlist?list...
✅✅✅[ May Leetcoding challenges] : • May LeetCoding Challen...
✅✅✅ Cracking the Coding Interview - Unique String: • Cracking the Coding In...
Problem Link: leetcode.com/problems/how-man...
Code: github.com/Algorithms-Made-Ea...
If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful.
#coding #leetcode #programminglife #programmingisfun #programmer #tech #software #codinglife #leetcode
nums=[8,1,2,2,3]
list1=[]
c=0
for i in nums:
j=i+1
c=0
for j in nums:
if j
This is truly 'algorithms made easy'. Thanks.
Glad it helped!
We can use buckets to further optimise this for the particular bounds of this problem :
class Solution {
public int[] smallerNumbersThanCurrent(int[] nums) {
int[] bucket = new int[102];
for(int num : nums) {
bucket[num+1]++;
}
for(int i=0;i
keep on bringing new leetcode solutions
Sure,