+ 3
I would really appreciate any suggetions on changing my new code "Count characters in your text".
Initially, the code was created for the purposes of practicing the continue statement. The code calls the same method for different characters of the alphabet 26 times and I would like to make it more elegant. I thought about creating an enhanced for loop for an array with latin alphabet, yet, I got stuck with errors and ceased my attempts. May be someone has any ideas how this can be done? :) https://code.sololearn.com/cz421Bm7EycK/?ref=app
6 Answers
+ 4
Your code had invisible non-spaces causing compile errors. I fixed those and added a for loop.
https://code.sololearn.com/cV1aGX7Ifrzv
+ 3
ZastanowiĆ bym siÄ nad poĆÄ
czeniem Class HashMap z ASCII, taka moja propozycja
MoĆŒna teĆŒ stworzyÄ dwie tablice o takiej samej wielkoĆci w jednej moĆŒna przechowywaÄ litery a w drugiej liczby
+ 3
Daniel, dzieki wielkie za odpowiedz, na razie nie mialam okazji pocwiczyc tworzenie HashMaps, wiec chetnie sprobuje wykorzystac to rozwiazanie z tym kodem
+ 3
John Wells, thank you very much for your solution, it is just the thing I thought about.
+ 3
No wlasnie, jak cwicze jakas konstrukcje, staram sie przy okazji wykorzystac inne rzeczy :)
+ 1
Zawsze moĆŒna sobie jakoĆ fajnie zadanie utrudniÄ :)
A to moje dzieĆo w drodze do pracy
https://code.sololearn.com/cHtFlV1H1tFX/?ref=app