TestCase 3 fail

Scanner scn = new Scanner(System.in);

	String in = scn.nextLine();
	
	
	Composition(in);

}

static void Composition(String in) {
	
	
	int[] count = new int[256];
	
	
	
	int len = in.length();
	
	
	for(int i = 0; i<len ; i++) {
		count[(int) in.charAt(i)]++;
	}
	
	
	for(int i = 0; i<256 ;i++) {
		if(count[i]!=0 && count[i]>1) {
		System.out.print((char)i+""+count[i]);
		}else if (count[i]!=0 && count[i]==1) {
			System.out.print((char)i);
		}
	}
	
	
}

}

@k.bhupenderagile when the input is aabbaa the answer should be a2b2a2 .your code gives a4b2

Please mark your doubt as resolved, if you are satisfied and you can give ratings too based on my response :slight_smile: