Lesson 17 of 23

String ಸಮಸ್ಯೆಗಳು: Reverse, Palindrome, Frequency

11 min 30 XP

Interviews ನಲ್ಲಿ strrev ನಂತಹ library helpers ಇಲ್ಲದೆ string ಕೋಡ್ ಬರೆಯಲು ಕೇಳುತ್ತಾರೆ. ಎರಡು tricks ಹೆಚ್ಚಿನ ಪ್ರಶ್ನೆಗಳಿಗೆ ಸಾಕು: ಎರಡೂ ತುದಿಗಳಿಂದ swap (two pointers) ಮತ್ತು 26 size ನ count array.

Example: edit me and press Run

Output Loading C (first time takes a few seconds)
Press Run to see the result here.

Challenge

+30 XP

scanf("%s") ಮೂಲಕ ಒಂದು lowercase ಪದ ಓದಿ, ಹೆಚ್ಚು ಬಾರಿ ಬರುವ ಅಕ್ಷರ ಮತ್ತು ಅದರ ಎಣಿಕೆ print ಮಾಡಿ. ಸಮವಾದರೆ ವರ್ಣಮಾಲೆಯಲ್ಲಿ ಮೊದಲ ಅಕ್ಷರವನ್ನು print ಮಾಡಿ. Input: banana → Output: a 3

Output Loading C (first time takes a few seconds)
Press Run to see the result here.