Java Two Sum Problem : Find Pair with given sum in an array

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

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

  • @suhelzende3169
    @suhelzende3169 3 ปีที่แล้ว +4

    How is it different than the first approach perhaps the if condition
    Both have same complexity

  • @infocelltell3394
    @infocelltell3394 4 ปีที่แล้ว +2

    Hi sir we can give like
    If(sum=arr(i) +arr(j+1)
    Then we can print i and j

  • @akashranjan2662
    @akashranjan2662 ปีที่แล้ว +1

    Still you are using 2 loops for it will decrease the performance.

  • @indiantourism975
    @indiantourism975 3 ปีที่แล้ว

    Thank you Sir