What are arrays, strings?

Data Structures & Libraries DSA practice problem on Onlearn.

Difficulty: easy.

Topics: What are arrays and strings in programming, and how are they used?, Arrays, Strings, Frequency Counting, Loops, Input/Output Operations, Data Types, string, data access, array, general programming, indexed data structures, Arrays, Strings, Memory Allocation, Data Mutability.

Character Frequency Counter Given a string S consisting of lowercase English letters, your task is to determine the frequency of each character. You should output the characters that appear at least once, along with their respective counts, in alphabetical order. Input Specification A single line containing the string S. Output Specification For each character that appears in S, print the character followed by its count, separated by a space, each on a new line. Characters should be sorted alphabetically. Constraints 1 <= |S| <= 10^5 S consists only of lowercase English letters. Sample Test Cases Sample Input 1: Sample Output 1: Sample Input 2: Sample Output 2: