Largest number in an array that is at least twice of others
Question: Given an array, there is a largest element N. Check if that number is at least twice than all the other elements in the array. Return the index if it is, else return -1 Input: {3, 6, 1, 0} Output: -1 6 is the largest integer, and for every other number in the array x, 6 is… Read More »