Number of possible permutations when absolute difference between number of elements to the right and left are given
Given an array of N elements where each element i, the absolute difference between total elements to the right and left of it are given. Find the number of possible ordering of the actual array elements.Examples: Input : N = 5, arr[] = {2, 4, 4, 0, 2} Output : 4 There are four possible orders, as follows: 2, 1, 4, 5, 3 2, 5, 4, 1, 3 3, 1, 4, 5, 2 3