Company: Msci_28july
Difficulty: medium
Maximize Beauty of an Array Problem Description The beauty of an array is the number of elements whose value equals their own position index, where positions are numbered starting from 1. Given an array of integers, you may repeat the following operation any number of times, as long as the array length is greater than 1: Choose any position i and delete the element at that position. The relative order of the remaining elements does not change, and every element that was after position i moves one position to the left. Determine the maximum possible beauty that can be achieved. Complete the function maximizeBeauty in the editor with the following parameter: int arr[n] : the given array Returns: int : the maximum possible beauty of the array Input Format The first line contains a single integer n , the number of elements in arr . Each of the next n lines contains a single integer, arr[i] . Output Format Print a single integer on its own line: the maximum possible beauty that can be achie