Pergunta de entrevista da empresa Amazon

Program to check for string pattern a^nb^m where m!=n , m>0,n>0