Question d’entretien chez Verizon

Q. String a=”aaaabbbbccc” Write an efficient code to count the number of alphabet