Data Structures & Algorithms in JavaScript — PS-1. Given an array, find the first pair whose sum is equal to zero? Input = [-5, -4, -3, -2, 0, 2, 4, 6, 8]. Output = [-4, 4]. Solution:Check the given array is sorted or not. If not sort the array. Approach 1: We need to traverse…

Read More