3066. Minimum Operations to Exceed Threshold Value II | Greedy | Time Complexity

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.พ. 2025
  • In this video, I'll talk about how to solve Leetcode 3066. Minimum Operations to Exceed Threshold Value II | Greedy | Time Complexity
    Checkout DSA-169 Series: • Aryan DSA-169 Series |...
    100Days 100k Placements: • 100 Days 100K Placement
    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 :)
    ✨ Timelines✨
    ✨ Hashtags ✨
    #programming #Interviews #leetcode #faang #maang #datastructures #algorithms

ความคิดเห็น • 6

  • @hello-tc3gz
    @hello-tc3gz 11 หลายเดือนก่อน +1

    bhai u r awesome!!!!

  • @krsurrya517
    @krsurrya517 11 หลายเดือนก่อน

    Thanks for your valuable efforts!!
    Can you pls tell which drawing tablet do you use for explanations ?

  • @AbhishekGupta-go9ft
    @AbhishekGupta-go9ft 11 หลายเดือนก่อน

    can we solve this problem using pbds(ordered set) ,int minOperations(vector& nums, int k)
    {
    pbds A;
    for (int i = 0; i < nums.size(); i++)
    {
    A.insert({nums[i], i});
    /* code */
    }
    int minoperations = 0;
    while((A.order_of_key({k,0}))!=0)
    {
    auto it = A.begin();
    long long value1= it->first;
    A.erase(it);
    if(value1>=k)
    {
    break;
    }
    auto it2 = A.begin();
    long long value2=it2->first;
    A.erase(it2);
    long long value=min(value1,value2)*2+max(value1,value2);
    A.insert({value,0});
    minoperations++;
    }
    return minoperations; this code is giving wrong answers

  • @learningmaths786
    @learningmaths786 11 หลายเดือนก่อน +1

    Hi aryan

  • @akshatchaturvedi7407
    @akshatchaturvedi7407 11 หลายเดือนก่อน

    Bhai good morning nhi good evening ho rhi thi tb

    • @harshal8781
      @harshal8781 11 หลายเดือนก่อน

      jaab jago tab sabera bro :)