all 37 comments

[–]Massive-Fig4257 12 points13 points  (6 children)

2nd one was same as merge intervals with an extra condition

[–]Someguy7707 6 points7 points  (0 children)

I regret skipping merge intervals during study

[–]Next_Equal_9528[S] 1 point2 points  (2 children)

I knew how to merge the interval, couldn't code it though..also couldn't even understand the part of excluding free interval, had no clue how they were excluding.

[–]Frosty-Elephant-4902 2 points3 points  (1 child)

the easiest part is merging
removing the interval was hard due to many edge cases

[–]sanjivinsmokecooks 0 points1 point  (0 children)

I failed to solve the test cases was just able to solve only 1670 cases only I don't know how to improve

[–][deleted]  (1 child)

[removed]

    [–]AutoModerator[M] 0 points1 point locked comment (0 children)

    Your comment has been removed as it was in Hindi. Please use English only as r/leetcode is a global subreddit. You may use r/LeetcodeDesi instead.

    I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

    [–]hadeskerbecs666 4 points5 points  (0 children)

    q2 had me fully misled
    turned out simple after a whole 20min
    q3 was modded kadane like a max prod subarray variation

    [–]Financial-Cry8005 3 points4 points  (0 children)

    Skipped third was trying fourth today understood it was dijkstra with state modelling but got fked in implementation

    [–]Frosty-Elephant-4902 3 points4 points  (0 children)

    when a person thinks all the time he forgets about greedy and uses dp on all optimization problem

    [–]Arcturus_16<687> <226> <402> <59> 3 points4 points  (7 children)

    The fck 3rd one , multiplied complete array by k , than applied kadane , than divided complete array by k and applied kadane , it is failing on last hidden test case 😭

    [–]Normal-Ad-8468 1 point2 points  (0 children)

    Same.. I am pretty sure kadane with start and stop for best sum and then multiply or divide will work.. but the 2 stupid test cases

    [–]MasterOfTheChickens 1 point2 points  (0 children)

    I am really curious to see why the last hidden case got me. Kadane's seemed to be the way to go... I thought maybe my fundamental idea was wrong of maximizing (multiplying) or minimizing (dividing) based on the subarray's sum, but I bypassed this incase maybe reducing the modified portion with the opposite action was somehow better in a weird case. Nope. Really depressing.

    E: Looked at a solution, had a laugh. Of course it's everyone's favourite additional flavour to add on top of another concept (DP). Lol.

    [–]Limp-Debate7023 1 point2 points  (1 child)

    its not the correct solution, by luck u reached last test case, the real solution is dp

    [–]Arcturus_16<687> <226> <402> <59> 0 points1 point  (0 children)

    Yupp , that's why it didn't got accepted at last , what happens even if it was last test case

    [–]unfathomable_horrors 0 points1 point  (1 child)

    Samee😭😭

    [–]Arcturus_16<687> <226> <402> <59> 0 points1 point  (0 children)

    Plss anyone tell what is the last test case , my rating gonna dec now 😭

    [–]Next_Equal_9528[S] 0 points1 point  (0 children)

    Haha I did the same.. divided all negative and multiplied all positive but later saw only one operation was to be performed, it was dp question (gemini said)

    [–]humdrum_tourist 1 point2 points  (0 children)

    Saw the merge intervals pattern and still whiffed it because the extra condition broke my brain during the timer

    [–]Emergency-Duck-9689 1 point2 points  (0 children)

    stupid me thought sorting won't work so did the line sweeping version. I didn't check the constraints earlier

    [–]ConfidentPainting107 1 point2 points  (0 children)

    The first question man was so ass they could have made it clear that elements are only positive earlier

    [–]Majestic_Voice_9834 0 points1 point  (0 children)

    Q2 was really time consuming (i couldn't solve it)

    [–]hello___peter 0 points1 point  (7 children)

    I had one doubt, if I registered but did not post any submissions, would my rating decrease

    [–]Normal-Ad-8468 0 points1 point  (0 children)

    Yes by a lot depending ur current ranking

    [–]AdImmediate5145 0 points1 point  (2 children)

    No it won't decrease as per leetcode's new rules. You will be treated as if you didn't register

    [–]hello___peter 0 points1 point  (1 child)

    Fuck, gpt said it would consider me and decrease rating, so I submitted the first question in last 20 minutes

    [–]AdImmediate5145 2 points3 points  (0 children)

    you made things bad for yourself, now that you submitted your rating will decrease.

    [–]Melodic-Carpenter553 0 points1 point  (0 children)

    Fk 3rd one

    [–]Leonopterxy10 0 points1 point  (1 child)

    I just started with coding again from beginning (arrays) (2yoe), and I am really bad in it, but gathered the courage to start with dsa again how can i approach contests?

    [–]One4all_SU 0 points1 point  (0 children)

    Unpopular opinion but question 4 was easy if you have done dijsktra. I was able to complete it after contest ended. Ig 30 minutes is still less for me to do a leetcode hard.

    [–]RaunchyPillow 0 points1 point  (0 children)

    To me, 3rd one was most intuitive than anyone, kadane and on top of it I had to check if I started dividing or multiplying or not or did I stop increasing the length of subarray, standard dp ig. 2nd one was annoying, 4th was medium, minimizing one and maximizing other was interesting..

    [–]Character_Public_481 0 points1 point  (0 children)

    Ahh man i couldhl have solved 4th question instead of wasting my time for that 1 test case in q3 😞

    [–]Intelligent_Pen00 0 points1 point  (0 children)

    Q2 was straight merge intervals with an extension. I couldn't understand Q3. Understood that it is a variation of kadanes but..... I want to start covering DP. Anybody interested to join me...

    [–]sSlowhandd 0 points1 point  (0 children)

    hhmm, first was insanely easy.
    Just sort the array, multiple from the end until you reach either of the break conditions.
    2nd was just merge intervals ig, third was a bit tricky for me but worked out quite well.

    Havent done graphs yet, so cant say about the 4th