Live Codechef Starters 133 Discussion | Abhinav Awasthi | coding75 Pro

Поделиться
HTML-код
  • Опубликовано: 25 июн 2024
  • Subscribe to the channel for Amazing Coding and Competitive Programming Content.
    Get all solutions here: coding75.com/dsa-cp/codechef/...
    Join Live Class Meet Here: coding75.com/classroom/live/c...
    🔥 Subscribe to coding75 Pro for Live Classes, 1:1 Mentorship Sessions: coding75.com/pro
    ✅ Live DSA Classes
    ✅ Codeforces, Codechef, Leetcode Live Discussion
    ✅ 1:1 Mock Interviews
    ✅ 1:1 Mentorship Sessions
    ✅ 1:1 Resume Review
    ✅ Live Weekly Project Building Sessions
    ✅ Live CS Fundamental Classes
    In case of any queries regarding coding75, WhatsApp us here: wa.me/message/TPN76XLWVOWDB1
    Or join our updates group: chat.whatsapp.com/KAXRJJUx2lA...
    🚀 Join Telegram for Post Contest Discussions, Coding Meets, and Important Updates, Join a Community of over 20,000+ Coders: t.me/cpabhinav
    📌 Follow me on Instagram for Regular Updates: / iammabhinav
    📌 Join my family of 40K+ on Linkedin: / abhinavawasthi01
    📌 Whatsapp Channel: whatsapp.com/channel/0029Va55...
    👉🏻 Coding Profiles
    My Codeforces: codeforces.com/profile/abhina...
    My Codechef: www.codechef.com/users/abhina...
    My Leetcode: leetcode.com/abhinavawasthi/
    👉🏻 Connect with Me
    LinkTree- linktr.ee/abhinavawasthi
    My LinkedIn- / abhinavawasthi01
    My Instagram- / iammabhinav
    My Facebook- / awasthi.abhinav.3
    My Twitter- / call_me_abhinav
    Coding Blogs- abhinavawasthi.code.blog/
    coding
    programming
    competitive programming
    software developer
    software engineer
    interview preparation
    interview experience
    dsa
    00:00 Introduction
    02:22 Devouring Donuts
    03:50 Legs on a Farm
    08:06 Maximum Alternating Sum
    16:08 Powered Parameters
    36:48 ABC Conjecture 3
    46:48 coding75 Pro

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

  • @AbhinavAwasthi
    @AbhinavAwasthi  Месяц назад +1

    🔥 Subscribe to coding75 Pro for Live Classes, 1:1 Mentorship Sessions: coding75.com/pro
    ✅ Live DSA Classes
    ✅ Codeforces, Codechef, Leetcode Live Discussion
    1:1 Mock Interviews
    1:1 Mentorship Sessions
    1:1 Resume Review
    ✅ Live Weekly Project Building Sessions
    ✅ Live CS Fundamental Classes
    In case of any queries regarding coding75, WhatsApp us here: wa.me/message/TPN76XLWVOWDB1

    • @sarathchandra5895
      @sarathchandra5895 Месяц назад

      @AbhinavAwasthi have a look at my approach
      int n = s.nextInt() ;
      int even_indices = 0 ;
      if (n % 2 == 0) even_indices = n/2 ;
      else even_indices = n/2 + 1 ;
      int arr[] = new int[n] ;
      for (int i = 0 ; i < n ; i++) {
      arr[i] = s.nextInt() ;
      }
      int sum = 0 ;
      Arrays.sort(arr) ;
      for (int i = n - 1 ; i >= 0 ; i--) {
      if (even_indices>0) {
      sum += arr[i] ;
      }
      else {
      sum -= arr[i] ;
      }
      even_indices-- ;
      }
      System.out.println(sum ) ;

  • @jitendrakumar-vv8ho
    @jitendrakumar-vv8ho Месяц назад +4

    who knew that brute force would work in powered parameters so i didn't tried it lol

  • @anshumaan1024
    @anshumaan1024 Месяц назад +2

    bhaiya pls cc ke aur contest ke bhi discussion kia kro na...

    • @AbhinavAwasthi
      @AbhinavAwasthi  Месяц назад

      Live discussion will be here: coding75.com/classroom

  • @sdmfslkdm
    @sdmfslkdm Месяц назад +1

    bhaiya proof wgera to dia ni ABC conjecture ka ? What was the intution of such solution ?

  • @priyanshkumariitd
    @priyanshkumariitd Месяц назад +1

    Thanks for Powered Parameters time complexity explanation!!!

  • @Dharmik852
    @Dharmik852 Месяц назад +1

    Thank you for making such informative videos!

  • @user-ti7jb6xp4n
    @user-ti7jb6xp4n Месяц назад

    Very Nice explanation thanku bhaiya

  • @tarunsingh2480
    @tarunsingh2480 Месяц назад

    Great explanation sir❤️🎉

  • @vibhanshusharma9143
    @vibhanshusharma9143 Месяц назад +1

    sir,in worst case it will be run for 30 times so the time complexity should be O(30*N) eventualy O(N), but you said O(logn) where do i mistaken.. because take {2,2,2,2,2,2........,(2*10^5)-1 time and,10^9} so in this case every 2 take 30 time ,

  • @akshayff2016
    @akshayff2016 Месяц назад

    string ans =s;
    cta=0;
    ctb=0;
    ctc=0;
    int buffer=0;
    int fans=0;
    int cc=0;
    int ca=0;
    for(int i=0;i

  • @top_g755
    @top_g755 Месяц назад +1

    Question d❤

  • @nikhilswami1096
    @nikhilswami1096 Месяц назад +1

    sir why this solution for ABC conjecture 3 is not right
    int a = 0;
    int b = 0;
    long long ans = 0;
    for(int i =0;i0){
    b++;
    }else if(s[i] == 'c'){
    if(a>0 && b>0){
    ans++;
    a--;
    }
    }
    }
    cout

    • @AbhinavAwasthi
      @AbhinavAwasthi  Месяц назад

      You are not handling cases where b is before a, you are just checking that a and b both are there

    • @nikhilswami1096
      @nikhilswami1096 Месяц назад

      like i want to ask what is the use of ca why we are not using a directly

    • @nikhilswami1096
      @nikhilswami1096 Месяц назад +1

      @@AbhinavAwasthi sir im checking in else if im checking if s[i] == 'b' and if a is greater than 1 than only im updating it

    • @AbhinavAwasthi
      @AbhinavAwasthi  Месяц назад

      You can join telegram for better discussion

    • @nikhilswami1096
      @nikhilswami1096 Месяц назад +1

      @@AbhinavAwasthi okay sir and yes i understood it like after finding one b we can't take a after that b but I'm taking it like if we have something like abaac in this we can make only one ABC but I will count 3 a and b is also 1 so we will make 3 but its is not correct. thank you sir

  • @OnlyAyushAgarwal
    @OnlyAyushAgarwal Месяц назад +1

    Too good 😊😊❤

  • @user-ti7jb6xp4n
    @user-ti7jb6xp4n Месяц назад

    #include
    using namespace std;
    void solve()
    {
    int n;
    cin >> n;
    vector v(n);
    for (auto &x : v)
    cin >> x;
    long long int maxi = *max_element(v.begin(), v.end());
    long long count = 0;
    for (int i = 0; i < n; i++)
    {
    if (v[i] == 1)
    {
    count += n;
    }
    }
    for(int i=0;i

    • @ritvikreddy3959
      @ritvikreddy3959 Месяц назад

      It is because of overflow.
      In the case of 2 , 2^31 ~ 1e9 but if you take 7^31 it overflows as 7^31 is very large due to which wrong value gets stored in your val variable. You can just add an if condition to check if val is greater than 1e9 , if it is you can just break the loop.

    • @singhshivam6730
      @singhshivam6730 Месяц назад

      take continue for case v[i]==1 it will work

    • @user-ti7jb6xp4n
      @user-ti7jb6xp4n Месяц назад +1

      @@ritvikreddy3959 thanku bhai 🙏

    • @user-ti7jb6xp4n
      @user-ti7jb6xp4n Месяц назад

      @@singhshivam6730 thanku bhai 🙏