Practice Arena
[Exp 1] MapReduce Word Frequency Tokenizer
UNIT-II Rubric: 10m Code + 5m Viva + 5m Record EASY 10 Marks
Session: 59:59
Bubblewrap Sandbox Active
Problem Statement
Implement the Mapper and Reducer aggregation logic for a simulated Hadoop MapReduce task. Given a stream of input lines, your program should normalize all words to lowercase, remove punctuation, and print each distinct word followed by its overall occurrence count in alphabetical order. This experiment simulates Phase 1 of Hadoop MapReduce: Mapping tokens into key-value pairs (word, 1) and Shuffling/Reducing them into aggregate counts (word, total).
Input Format
Line 1 contains an integer N representing the number of sentences. The following N lines contain textual strings.
Output Format
Print each unique word and its frequency separated by a single space, sorted alphabetically line by line.
Constraints
1 <= N <= 100 Total words <= 10^4 Input strings consist of alphanumeric characters and spaces.
Status Lang Score Time Submitted
No prior submissions for this problem.
Ready
Click Run Code to evaluate against sample test cases, or Submit Solution for full evaluation.
Instructor Guidance