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.