3098. Find the Sum of Subsequence Powers | 4D DP | time- O(n^5) [*will be updated for O(n^4)]
HTML-код
- Опубликовано: 11 сен 2024
- In this video, I'll talk about how to solve 3098. Find the Sum of Subsequence Powers | 4D DP | time-O(3 * 1e8)
Let's Connect:
📝Linkedin: / aryan-mittal-0077
📸 Instagram: / ez.pz.dsa
📱Telegram : t.me/aryan_mit...
🤖 Github: github.com/ary...
About Me:
I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
✨ Hashtags ✨
#programming #Interviews #leetcode #faang #maang #datastructures #algorithms
A bit modification & Optimisation can lead us to O(n^4) which is completely acceptable - leetcode.com/problems/find-the-sum-of-subsequence-powers/solutions/4949120/2d-dp-oh-it-is-fast/
Those unordered maps are too long, I think we can generate a string key by concatinating all four into a string with special character in between and then storing it in a single map
yes you are right and that would be a lot better than this
amazing keep it up
Great explaination bhaiya ❤ ,is there any limit on the max no. of distinct keys in case of unordered map just like array(1e6 for continuous memory allocation)? Pls do reply.
Aryan Bhaiya ,the code you provided o(3)*(1e8) is not getting accepted now .....tle on last tc !!!
Thanks Bro
Thank you
17:49 was personal 💀💀
I used vector and worked better
N^5 getting AC is bullshit
So true bro
Hello bhaiya i founded this now I want to excel in dsa any such
I tried so long but couldn't solve the problem