Help me in solving MISSP problem

My issue

solve this problem using sorting approach

My code

import java.util.*;
import java.lang.*;
import java.io.*;

class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		

	}
}

Learning course: Arrays, Strings & Sorting
Problem Link: Chef and Dolls Practice Problem in - CodeChef

@luciferpk
the logic for sorting is just compare each element to its previous element or just next element if any of them are not same then it will be your answer.