2938. Separate Black and White Balls || Greedy 🔥 || 2 Pointers 🔥

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

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

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

    Question states that we can swap only adjacent elements. However we are seen swapping the numbers in a particular range.

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

      We are swapping in particular range and we are adding the difference of that range to our solution.

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

    can you explain how did you think of this approach

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

    Great solution brother😄

  • @Gods_plan-g1l
    @Gods_plan-g1l 10 วันที่ผ่านมา

    2 pointer