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.