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

Комментарии • 15

  • @ARYANMITTAL
    @ARYANMITTAL  5 месяцев назад +6

    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/

  • @rkb_404
    @rkb_404 5 месяцев назад +4

    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

    • @satyamkumarjha8152
      @satyamkumarjha8152 5 месяцев назад

      yes you are right and that would be a lot better than this

  • @Anuj-vf7bg
    @Anuj-vf7bg 5 месяцев назад

    amazing keep it up

  • @adityachaturvedi4369
    @adityachaturvedi4369 5 месяцев назад

    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.

  • @asthajain2511
    @asthajain2511 4 месяца назад

    Aryan Bhaiya ,the code you provided o(3)*(1e8) is not getting accepted now .....tle on last tc !!!

  • @harikrushnasuhagiya3925
    @harikrushnasuhagiya3925 5 месяцев назад

    Thanks Bro

  • @IK-xk7ex
    @IK-xk7ex 5 месяцев назад

    Thank you

  • @Rohitrootn
    @Rohitrootn 5 месяцев назад

    17:49 was personal 💀💀

  • @samsingh43
    @samsingh43 5 месяцев назад +1

    I used vector and worked better

  • @lazyemperor5182
    @lazyemperor5182 5 месяцев назад +5

    N^5 getting AC is bullshit

  • @user-yv1jr5oo8h
    @user-yv1jr5oo8h 5 месяцев назад

    Hello bhaiya i founded this now I want to excel in dsa any such

  • @vineetmittal788
    @vineetmittal788 5 месяцев назад

    I tried so long but couldn't solve the problem