Company: Zomato
Difficulty: medium
Beautiful element Problem Description An element in the array A at an index ind is called beautiful if the sum of elements from index 0 to ind-1 is less than or equal to A[ind] . In other words, an element is beautiful if it is greater than or equal to the sum of elements before it. The first element of the array is always considered to be beautiful. You are given an array A of N integers. Task: Determine the maximum number of beautiful elements in the array after rearranging the array. Function Description Complete the function countBeautiful provided in the editor. This function takes the following 2 parameters and returns the required answer: N : Represents the size of array A A : Represents the elements of array A Input Format The first line contains a single integer T which denotes the number of test cases. T also denotes the number of times you have to run the countBeautiful function on a different set of inputs. For each test case: The first line contains an integer N denoting t