2025 May OPPE 1 -Set 5¶
Section 1 · Question 1
Position of Point Relative to Line
Determine which side of a line a point lies on. Covers sign evaluation and the (val>0)-(val<0) trick.
Section 1 · Question 2
Expand Sum of Products
Parse and expand (a+b)(c+d) into four product terms. Covers string splitting and itertools.product.
Section 1 · Question 3
Repeat Second Half of a Tuple
Append the second half of a tuple to itself. Covers ceiling division (n+1)//2 and tuple concatenation.
Section 2 · Question 1
Excel Column Name to Index
Convert "A", "AA", "ZZZ" to a 1-based index. Covers bijective base-26 and Horner's method.
Section 2 · Question 2
Reverse Vowel Order
Reverse only the vowels in a multiline string, keeping everything else in place. Full I/O problem covering iter() + next().
Section 3 · Question 1
Chess Game Analysis
Six functions on a chess game string -parse moves, count pieces, checks, captures, and most-used piece per player.
SolvedSection 3 · Question 2
Visualize Pattern Lock
Render a 3×3 pattern lock grid showing visit order. Full I/O problem covering grid indexing and enumerate(seq, 1).