1-) Bir sayı dizisi ve hedef değeri veriliyor. Toplamı, hedefe eşit olan ikililerin indexlerini dönen fonksiyonu yazınız.
Örnek 1:
Input: nums = [2,7,11,15], target = 9 Output: [0,1] Output: Çünkü nums[0] + nums[1] == 9, return [0, 1].
Örnek 2:
Input: nums = [3,2,4], target = 6 Output: [1,2]
Örnek 3:
Input: nums = [3,3], target = 6 Output: [0,1]
target = a + b;
Takes each number with a loop then loop through the others and compare them.
target - a = b;
Takes each number with a loop then subtracting this number to target. That will give us a which number should find on array.