3266. Final Array State After K Multiplication Operations II | Weekly Leetcode 412

Поділитися
Вставка
  • Опубліковано 20 гру 2024

КОМЕНТАРІ • 23

  • @princekumar-xe9ex
    @princekumar-xe9ex 5 днів тому

    Really Helpful

  • @nabajyotimajumdar4511
    @nabajyotimajumdar4511 3 місяці тому

    Amazing !!! thank you!

  • @anmolbansal4009
    @anmolbansal4009 3 місяці тому +1

    what a great explanation....i just discovered your channel today....other people have just wrote the code and didnt tell intuition behind working of it.....u gave such a detailed explanation with proper intuition.....will come every week to see solution of the contest questions which i will not be able to solve.....please never stop uploading.....maybe u r getting less views now but 1k-2k people who are watching i am sure are getting a great help from this....thanks

  • @priyanshupriyadarshi502
    @priyanshupriyadarshi502 3 місяці тому

    a great, easy to follow and comprehensive explanation 🔥

  • @ankitghosh9873
    @ankitghosh9873 3 місяці тому

    Amazing explanation also do a dry run of code also for beginners

  • @anomalyed
    @anomalyed 3 місяці тому

    Thank you, great explanation!

  • @mehak_mits
    @mehak_mits 3 місяці тому

    Great Explanation!

  • @mayanksharma2039
    @mayanksharma2039 3 місяці тому +1

    So good video. Crystal clear. Please continue making such type of videos very helpful

  • @nikhilprakash729
    @nikhilprakash729 3 місяці тому +1

    Great Solution Bhaiya..

  • @MayankGour-c9p
    @MayankGour-c9p 3 місяці тому

    Overwhelmed by the explanation :)

  • @AnandKumar-kz3ls
    @AnandKumar-kz3ls 3 місяці тому +1

    thank mohan, for this much-needed video i really appreciate it

  • @rishabhgoel8936
    @rishabhgoel8936 3 місяці тому +2

    THIS QUALITY CONTENT >>>>>>>

  • @bikramjitdas2621
    @bikramjitdas2621 3 місяці тому +1

    Your channel is a gem, the only feedback which I would like to give you- there are too many playlists which are not organized in the easier to harder order. For beginners, it is confusing if they want to follow you or which path to follow step by step. Could you please make a dedicated video / organize your content in easy to high level problems as such it would be easy for everyone to follow? Thanks!

  • @selvaragavan_10
    @selvaragavan_10 3 місяці тому

    Great explanation. Improve your thumbnail you deserve more ❤🎉

  • @SasankNasika
    @SasankNasika 3 місяці тому

    thank you

  • @lambukushireddy424
    @lambukushireddy424 Місяць тому

    QUALITY>>>

  • @vishnu4647
    @vishnu4647 3 місяці тому

    thnxx keep going.

  • @SasankNasika
    @SasankNasika 3 місяці тому +1

    god's work

  • @deepghosal7631
    @deepghosal7631 3 місяці тому

    is this any cp concept? how 300 people solved this in the time of contest?

  • @manikantasai6118
    @manikantasai6118 3 місяці тому +1

    bro mohan is your real name?

    • @codingmohan
      @codingmohan  3 місяці тому +1

      My real name is Subham.

    • @dawodujohnson
      @dawodujohnson 3 місяці тому +1

      ​@@codingmohanall hail king Subham

  • @mohdhammadsiddiqui7598
    @mohdhammadsiddiqui7598 3 місяці тому

    sir not able to understand whats wrong in my code class Solution {
    public:
    const int MOD = 1000000000+7;
    long long power_mod(long long base, long long exp) {
    long long result = 1;
    while (exp > 0) {
    if (exp % 2 == 1) {
    result = (result * base) % MOD;
    }
    base = (base * base) % MOD;
    exp = exp / 2;
    }
    return result;
    }
    vector getFinalState(vector& nums, int k, int multiplier) {
    if(multiplier ==1) return nums;
    priority_queue minHeap;
    int initialMaximum =0 ;
    int initialMaximumIndex = -1;
    for(int i=0 ;i initialMaximum) {
    initialMaximum = nums[i];
    initialMaximumIndex = i;
    }
    }
    while(k> 0 && minHeap.top().first*multiplier 0) {
    nums[minHeap.top().second]=(minHeap.top().first*multiplierKiPowerKaResult)%MOD;
    minHeap.pop();
    }
    for(int i=0 ;i