Why Infosys asked such hard OA ? Graph + Segment Tree! Kumar K Training

Problem Doc docs.google.com/document/d/10...
1-1 Mentoring and Daily Live Training Cohort for DSA + OA + CP - training.desiqna.in/

Пікірлер: 7

  • @User-Shringarkay1
    @User-Shringarkay18 күн бұрын

    Great sir 💯

  • @karandeepsingh6201
    @karandeepsingh62018 күн бұрын

    Brilliant Solution Sir 🎉🎉🎉

  • @meme_Overflow
    @meme_Overflow8 күн бұрын

    unmatchable level sir

  • @darshanrajpattanaik2154

    @darshanrajpattanaik2154

    8 күн бұрын

    Why is your codeforces rating?

  • @darshanrajpattanaik2154
    @darshanrajpattanaik21548 күн бұрын

    Why not keep a left and right variable that gives the last updated index and decrement and increment further, do not check in-between values of left and right?

  • @KaranKumar-hw2bq

    @KaranKumar-hw2bq

    8 күн бұрын

    That doesn't work in all cases especially when the array is huge and many forbidden cases are there.

  • @darshanrajpattanaik2154

    @darshanrajpattanaik2154

    8 күн бұрын

    ​​​@@KaranKumar-hw2bqCan you give any counter case? Yes, there maybe forbidden ones, we make a hashmap or something to check if the current index is possible or not, then I can check invalid >r(storing rightmost index), i.e. check each value of r +2n in a iterative way and update r accordingly. Similarly we can do for left.