Three Sum
Në shqip: Problemi Three Sum
ShpjegimiSQ
Gjej treshet që mblidhen në zero. Rendit vargun, fikso një element dhe për pjesën tjetër përdor dy tregues — O(n²). Kujdes nga përsëritjet. Tregon si kombinohen renditja dhe dy treguesit.
EnglishEN
Find the triplets that sum to zero. Sort the array, fix one element and use two pointers on the rest — O(n²). Watch out for duplicates. It shows how sorting and two pointers combine.
Si ta mendosh
Si të formosh grupe treshe me peshë totale të caktuar.
Lexoje në anglisht
Like forming groups of three with an exact total weight.