One test case if failed

please elaborate the test case my code is import java.util.*;
public class Main
{
public static void main(String args[])
{
int i;
char ch=’ ',ch1;
Scanner sc=new Scanner(System.in);

	String s=sc.nextLine();
	s=s.toLowerCase();
	if(s.length()>=1&&s.length()<=1000)
	{
		for(ch1='a';ch1<='z';ch1++)
		{
			int k=0;
			for(i=0;i<s.length();i++)
		{
		ch=s.charAt(i);
		
		if(ch==ch1)
		{
		k++;
		
		}
		}
		if(k>0)
		{
			
			System.out.print(ch1);
			if(k>1)
		
		System.out.print(k);
		}
		
	}
	
	}

}
}

@mohdkaifalam041,

test case:
aabbaa
Correct answer: a2b2a2
your answer: a4b2

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.