Created
January 8, 2020 04:47
-
-
Save parzibyte/44cc12081409f8c47d3afcf8cbf4adfa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Recorremos la cadena letra por letra y vemos si es una vocal | |
for (int x = 0; x < cadena.length(); x++) { | |
char letraActual = cadena.charAt(x); | |
if (esVocal(letraActual)) { | |
// La clave es la vocal en sí, pero en minúscula | |
String clave = String.valueOf(letraActual).toLowerCase(); | |
// Aumentamos el conteo en esa clave | |
hashMap.put(clave, hashMap.get(clave) + 1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment