Week 3
Week 3: Functions, Dictionaries, and Data
Combine functions with dictionaries, counting, lookups, and data patterns used in PCEP and beginner contest practice.
Week 3: Functions, Dictionaries, and Data
Students learn to organize code with functions and solve data-focused problems with counting, dictionaries, and prefix sums.
Topics
- functions, parameters, and return values
- decomposition
- dictionaries and frequency counting
- lookups
- prefix sums
Required Problems
- Practice Groups
- Completed Modules
- Project Tags
- Word Frequency
- Prefix Sum Queries
Lesson completion is automatic. Students complete the week when every required problem has an accepted submission.
Required practice
Problems for this lesson
Solve all assigned problems to complete the week.
Practice Groups
Each mentor group can hold `k` students. Given `n` students, print the minimum number of groups needed.
Completed Modules
A student earns points for each completed module. Given `n` point values, compute the total.
Project Tags
Given `n` project tags and one target tag, count how many times the target appears.
Word Frequency
Count how many times a target word appears in a sentence.
Prefix Sum Queries
Answer range sum queries on a list using 1-based inclusive indexes.