2024 Sep OPPE 1 - Set 3¶
Divisible by Exactly One
Check if a number is divisible by exactly one of two given numbers. Covers XOR with != and the ^ operator.
Date Format: mm-dd-yy → yy-dd-mm
Reorder a date string by swapping month and year. Covers split() unpacking and string slicing.
Increment Dict Value with Max Limit
Increment a dict value in-place, capping at a limit. Covers min() as a natural cap and in-place modification.
Last Word Starting with Uppercase
Find the last word whose first letter is uppercase. Covers the "last wins" overwrite pattern and next(reversed(...)).
Swap and Reverse Alternate Lines
Swap consecutive line pairs and reverse the first of each pair. Full I/O - covers lookahead buffering and [::-1].
Word Filters
Filter words by four criteria - continuous, vowel-rich, consonant-rich, sorted. Covers lambda dispatch dicts and vowel/consonant counting.
SolvedN Pattern
Print an N-shape with | bars and a diagonal \. Full I/O - covers the diagonal position formula and backslash escaping.