leetcode new problems

This commit is contained in:
2026-02-11 14:48:41 +05:30
parent 192ce44a81
commit 0f52d46c67
29 changed files with 658 additions and 5 deletions
+7
View File
@@ -0,0 +1,7 @@
The intuition in this problem is we first sort the entire list and then fix i on first index and j at i+1 and k at last index and then compute total ,if(total>0) then since it is sorted, we need to bring total down so we do k-- and if total<0 then j++
To avoid recomputations for same j, we do j++ until nums[j]!=nums[j-1]
TC : o(nlogn) + o(n*n); SC : o(1)