Efficient approach using Prefix Sum Array : 1 : Run a loop for 'm' times, inputting 'a' and 'b'. 2 : Add 100 at index 'a' and subtract 100 from index 'b+1'. 3 : After completion of 'm' operations, ...
In this Kata, you will be given an array of numbers in which two numbers occur once and the rest occur only twice. Your task will be to return the sum of the numbers that occur only once. For example, ...