A, B, C | Leetcode Biweekly Contest 137 Editorials | Maximum Value Sum by Placing Three Rooks

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ต.ค. 2024

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

  • @AbhinavAwasthi
    @AbhinavAwasthi  2 หลายเดือนก่อน +2

    Please Like and Comment
    Join Whatsapp Channel: whatsapp.com/channel/0029Va55Idf1NCrU16kHOt3j
    Join Telegram Channel: telegram.me/cpabhinav

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

    Very nice explanation of problem C

  • @ravikotadiya3403
    @ravikotadiya3403 2 หลายเดือนก่อน +6

    actually 4th question need tabulation only and your logic for 3rd is exact same for 4th question
    here's the code:
    #define ll long long
    class Solution {
    public:
    int row, col;
    long long maximumValueSum(vector& board) {
    vector temp(board.size(), vector(board[0].size()));
    row = board.size();
    col = board[0].size();
    for(int i=0; i

    • @aysheri8321
      @aysheri8321 2 หลายเดือนก่อน

      nice soln.

    • @tejasjaulkar9658
      @tejasjaulkar9658 2 หลายเดือนก่อน

      but tc is always same for memoi and tabulation only sc is changing so how

    • @RajeevCanDev
      @RajeevCanDev 2 หลายเดือนก่อน

      @@tejasjaulkar9658 However, the constant factor in terms of execution speed might differ between the two approaches, as tabulation avoids the overhead of recursive function calls. In practice, this makes tabulation sometimes slightly faster.( therefore always try optimizing your code upto tabulation if possible)

  • @abhinavkumar4375
    @abhinavkumar4375 2 หลายเดือนก่อน

    Thanks , Good content

  • @RajeevCanDev
    @RajeevCanDev 2 หลายเดือนก่อน

    we can also do it using normal knapsack way, by storing all the ( row , col ) combination in a vector pair and choose the maximum 3 pairs which are valid, by using either a additional array or simple mapping

  • @harchitgulati3065
    @harchitgulati3065 2 หลายเดือนก่อน

    bhaiya aapka hi intezaar tha pls baaki codechef and codeforces ke solution bhi nikaala karo..aapke approaches are very intuitive

  • @somsk56
    @somsk56 2 หลายเดือนก่อน

    Is it possible to solve first question in SC 0(1) ?

  • @dakshmaru5577
    @dakshmaru5577 2 หลายเดือนก่อน +2

    Bhai to be honest the dp you are using in 3rd question is of no use, in the dp you are storing result of a triplet of indexes. and any triplet won't occur twice in any case. So it won't ever enter the case (if dp[i][firstj+1][secondj+1] != -1) So that would get accepted without even using dp. The memoization you used was of no use. Anyways Great Explanation... Keep putting up such content.

    • @AbhinavAwasthi
      @AbhinavAwasthi  2 หลายเดือนก่อน

      Bro, you are wrong
      It's not possible
      If you think it is possible, can you please share the code

    • @AbhinavAwasthi
      @AbhinavAwasthi  2 หลายเดือนก่อน +1

      Yeah, that is what I am asking, can you please do the same and send me the submission link?

  • @Lakshya-f4l
    @Lakshya-f4l 2 หลายเดือนก่อน

    Helpful

  • @VishalKumar-uu3xm
    @VishalKumar-uu3xm 2 หลายเดือนก่อน

    Great explaination

  • @arnav6885
    @arnav6885 2 หลายเดือนก่อน +1

    Can't A problem solved with sliding window??

    • @shreyasharma7987
      @shreyasharma7987 2 หลายเดือนก่อน

      We can solve it using sliding window approach

  • @yogeshrajput6331
    @yogeshrajput6331 2 หลายเดือนก่อน

    please upload weekly contest solution also

  • @Divyansh-x7n
    @Divyansh-x7n 2 หลายเดือนก่อน +2

    Hello Abhinav Bhai. Firstly your videos are really helpful thanks for it. I want to ask how should I improve in contests. I have solved 300+ problems on Leetcode and today I gave my 8th contest. but i was only able to solve first problem and was not able to optimize it. Usually also I am able to solve only 2 ques. in lc contest ( 1 easy 1 medium). I dont know what i am doing wrong. HOW CAN I IMPROVE?

    • @Aksht-h9u
      @Aksht-h9u 2 หลายเดือนก่อน

      bhai 1 question toh maine hi kar liya tha aaj. it was my first contest and i have only solved 42 leetcode problems. I think tumhe logic bnane mein ya fir time constraint mein logic kaise bnana hai usme dikkat aa rahi hogi. Zyada contest do aur khudse logic bnane ka try kro. Best of luck.

    • @GamingFlixff
      @GamingFlixff 2 หลายเดือนก่อน +1

      Bro we are sailing in the same boat , I started solving problems in Leet code from last year end ,
      Sometimes we solve medium questions easily in contest because we previously solved same pattern questions or same logic questions the only way to mastering logical thinking is to solve more problems without thinking about failure,
      Understanding the problem statement (most of us failed in this) after comes with brute force solution don't think about optimal solution first, because it's leading to wrong solution.
      Most importantly don't give up if you feel demotivated take break or try understanding others solutions we learn from our mistakes
      I solved q2 using queue
      Don't overthink, keep going on path

  • @mrlord8519
    @mrlord8519 2 หลายเดือนก่อน

    Really helpful

  • @Tam-wc2qm
    @Tam-wc2qm 2 หลายเดือนก่อน +2

    i thought this but didn't do😭😭

  • @jvinay2210
    @jvinay2210 2 หลายเดือนก่อน

    At contest i fidnt get b

  • @ANKIT-mo2ov
    @ANKIT-mo2ov 2 หลายเดือนก่อน

    Helpful

  • @yashkalia2311
    @yashkalia2311 2 หลายเดือนก่อน

    Helpful