Was able to solved using bruteforce approach but got TLE :( Though got intuition of solving using prefixSum but could'nt Thank you for your explanation sir :)
Recently solved a segment tree RMQ + Binary search. Frequency count is similar to RMQ. Please use that video. Goto the channel page and scroll past 15 videos you will see on thumbnail :)
dont focus on the beats on leetcode as it differs based upon the engine. You can verify this by submitting the same code different times but you get different beats
You are amazing man keep it up ❤🔥
thanks :)
Was able to solved using bruteforce approach but got TLE :(
Though got intuition of solving using prefixSum but could'nt
Thank you for your explanation sir :)
Nice work!
Thank you so much for this video
welcome :)
Completed Sir.
Great! 👍
please DRY run in java code also , its humble request
In java i got error due to int conversion it fgot solved using long to sum and prefix sum
but involves alot of trials and error!
@@keerthivasan138 copy your code then paste to chatgpt then him where is error and explain how .
@@keerthivasan138 yes same for me. getting one last test case failed due to this. but after using long its fixed.
@@keerthivasan138 can i get your code ? or share me you leetcode profile link
Bro can you explain the problem 2080. Range Frequency Queries using segment tree in leetcode. I tried but can't solve the problem using segment tree.
Recently solved a segment tree RMQ + Binary search.
Frequency count is similar to RMQ.
Please use that video.
Goto the channel page and scroll past 15 videos you will see on thumbnail :)
Sir One small Doubt wouldn't Prefix array take space? So,Space Complexity is O(N)
I dint take prefix array.
Just a sum variable :)
I wrote the same code but it beats only 64%, why?
dont focus on the beats on leetcode as it differs based upon the engine.
You can verify this by submitting the same code different times but you get different beats
how to find which one fit ,whether int or long ?
number of items * max value of item
@techdose4u understood sir
nice