Leetcode 1679 | Max number of k-sum pairs | 13th from LC 75 | 90 days SE prep
Вставка
- Опубліковано 12 вер 2024
- Question Details - • DSA Phir se with Sumee...
My instagram - / sms_pec
Scaler School of Technology Link - bit.ly/sst-fro...
About the Video -
I am simulating a scenario to create content. I will be preparing for a SE job across the next 90 days or so, till Mar 31 2024. I have created a preparation plan for that. Let's do it together.
This is 13th from Leetcode 75
Question number is Leetcode 1679.
Question name is "Max number of k-sum pairs"
Don't forget to share your progress with me here - / @sumeet1188
I am doing the following work these days
1. DSA Phir se: • DSA Phir se with Sumeet
2. Dream and Build with Sumeet: / @dnb-with-sumeet
3. JEE Prep: / @sumeet-malik-for-11th...
4. Powerlifting: / sms_pec
5. Journal of progress:
/ @sumeet1188
My instagram, linkedin and twitter are also pretty interesting.
LinkedIn: / sumeet-malik-ab650410
Twitter: / sumeetmalik17
Instagram: / sms_pec
Lift weights. Be Curious. Dream and Build,
Sumeet
class Solution {
public int maxOperations(int[] nums, int k) {
int ans=0;
Arrays.sort(nums);
int fi=0;
int li=nums.length-1;
while(fi
sir the way u explain , outstanding
great explanation sir 🫡
bhai naya video kab ayega
public int maxOperations (int[]nums,int k){
Mapmpp=new HashMap();
int cnt=0;
for(int i=0;i0){
cnt++;
mpp.put(k-nums[i],mpp.get(k-nums[i])-1);
}else {
mpp.put(nums[i],mpp.getOrDefault(nums[i],0)+1);
}
}
return cnt;
}
}
Tc=0(n);
SC=0(n);