Lesson 24 of 34
Characters, ASCII
9 min 30 XP
ഓരോ char-നും ഒരു സംഖ്യയുണ്ട് (അതിന്റെ ASCII/Unicode code): 'A' = 65, 'a' = 97, '0' = 48. അതിനാൽ chars ഉപയോഗിച്ച് കണക്കുകൂട്ടാം: 'a' + 1 എന്നാൽ 'b'.
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.26 size ഉള്ള int array ഉപയോഗിച്ച് അക്ഷരങ്ങളുടെ frequency എണ്ണൂ: count[ch - 'a']++. ഈ trick anagram, first-non-repeating-character ചോദ്യങ്ങൾ പരിഹരിക്കുന്നു.
Example: edit me and press Run
Output Loading Java (first time takes a few seconds)
Press Run to see the result here.