Minimize sum of numbers required to convert an array into a permutation of first N natural numbers
Given an array A[] of size N, the task is to find the minimum sum of numbers required to be added to array elements to convert the array into a permutation of 1 to N. If the array can not be converted to desired permutation, print -1. Examples: Input: A[] = {1, 1, 1, 1, 1}Output: 10Explanation: Incr