Function to return the minimum number of operations needed to partition the array in k contiguous groups such that all elements of a given group are identical
static int getMinimumOps ( int [ ] ar , int k ) {