Maximum occurred integer | gfg potd | 07-06-2024 | GFG Problem of the day
Вставка
- Опубліковано 29 вер 2024
- Geeks for Geeks Problem of the Day(POTD) in C++ | Maximum occurred integer | Fully Explained🧠
Solution Code :
github.com/Ish...
IMPORTANCE OF DSA FOR PLACEMENT:
• Is DSA Still Important...
BEST FREE WEB DEVELOPMENT COURSE:
• Video
🌐 Connect with Me:
GitHub: github.com/Ish...
Linkedin: / ishansawhney
#GFG #POTD #geeksforgeeks #problemoftheday #c++
To understand programming we need logic not magic 😊. What is the intuition behind putting decreasing -1 for upper bound ?
I agree what you said but this is called as difference array technique which is a pre step for prefix sum method which we used to solve this problem and I can't explain all this from the scratch in one video as they are different concepts so I suggest you to first get through the prefix sum approach then all your doubts will be cleared 😊
Why nobody talks about the intution, this can be understood by just doing dry the code in comments section. Please try to show the intution
I understand your concern but see prefix sum method which we used to solve this problem I can't explain all this from the scratch in one video as they are different concepts so I suggest you to first get through the prefix sum approach then all your doubts will be cleared .for example, if we encounter a dp problem...we find how can dp be applied on it but we don't start to first explain what is dp...same is with this case 😊
bhai aapki voice RJ ke liye achi hai aap mimicry bhi try kro
Thanks Bhai krunga try ❤️
Count should be initialize with maxx+2 rather than maxx+1.
Why? We have maxx elements and array indexing is 0 based so maxx+1 is fine
@@CodeGenius316 +1 for last element storing and +1 more for doing -1 in their next index answer in count array.(use Maxx+2 to handle r[i] +1 case)
Yes you're right for safety purpose it's good to have maxx+2 but here
Using an array of size maxx + 1 is typically sufficient for handling the range increment and decrement operations correctly.😊