Minimize Array partitions such that an element is repeated atmost once in each partition
Given an array arr[] consisting of positive integers. The task is to minimize the contiguous groups formed if each element from arr[] can be a part of atmost one group, and a number can be repeated only once. Examples: Input: arr[] = {1, 2, 1, 1, 1, 1, 1, 2, 3}Output: { {1, 2, 1}, {1, 1}, {1, 1, 2,