Check if a Sequence is a concatenation of two permutations
Given an array arr containing positive integers, the task is to check if the given array arr is a concatenation of two permutations or not. A sequence of M integers is called a permutation if it contains all integers from 1 to M exactly once. Examples: Input: arr[] = {1, 2, 5, 3, 4, 1, 1} Output: No