Great way of explaining ......Keep doing🙏🙏Thank you so much
@sauravchandra10 Жыл бұрын
I was missing the sliding window part, thanks for explaining it so clearly!
@vcs64911 ай бұрын
Excellent work
@Ajay-k5i Жыл бұрын
Nice explanation with great approach
@anug142 жыл бұрын
thanks using prefix sum directly is more readable for me: public int maxFrequency(int[] nums, int k) { Arrays.sort(nums); int n = nums.length; // prepare prefix sum int[] pre = new int[n]; pre[0] = nums[0]; for(int i = 1; i < n; i++){ pre[i] += pre[i - 1] + nums[i]; } // start binary search int ans = 1; int l = 1; int r = n; while(l
@sumanthvarma1908 Жыл бұрын
Excellent explanation Thank you
@iamnoob7593 Жыл бұрын
Thanks Man , I Understood , But main key part is to understand why sorting is required and why sliding window is required .
@shivamuniyal9274 Жыл бұрын
agreed 🙂
@Amansharma-dr6cx3 жыл бұрын
Keep it up man, clean approach and solution.
@adityarajiv63463 жыл бұрын
Thanks😀. Please share the channel with all your friends and subscribe 👍
@ankitsharda1131 Жыл бұрын
Superb explanation man!!
@kumarabhishek94772 жыл бұрын
Nice approach and explanation. Keep the good work going.
@aftabhaider85562 жыл бұрын
very good approach
@the_amey_parashar8 ай бұрын
why did we apply binary search?
@kalyan5392 жыл бұрын
hey one doubt at 16.31 time u said 7+4=11 [1,4,8] range ..i didnt get which operations u did!
@lover_of_u3455 Жыл бұрын
Means (8-1)+(8-4)=7+4=11
@lover_of_u3455 Жыл бұрын
To make 1 and 4 equal to 8 we have to increase 1 by 7 operation and increase 4 by 4 operation. Total operations required to make all the element equal to 8 is 11
@ajitpalsingh98052 жыл бұрын
great approach man keep it up
@shivamaggarwal7357 Жыл бұрын
i converted your code in java and it is not working??? please write a java code
@AbhishekRaj-vr8rb2 жыл бұрын
thanks bhaiya...
@adityarajiv63462 жыл бұрын
Welcome😀👍. Please share the channel with all your friends 👍
@ankit_yadav1111 ай бұрын
bhai runtime error q aa rha h line by line match kar chuka hun ayar
@ananypandey13102 жыл бұрын
what does 1LL represent ?
@adityarajiv63462 жыл бұрын
long long int
@Randomuser7890 Жыл бұрын
why are we sorting???
@lover_of_u3455 Жыл бұрын
Since we can only increase the number by 1 and we need all the element that were less than target so that with the help of k operations we can make them equal to the target value value that's why we sort it