Skip to main content
πŸ“œ WAYPOINT LESSON

Checkpoint β€” The Small-n Law

⭐⭐⭐ advanced⏳ 20 min readπŸ“ Lesson 255 of 281

n ≀ 20: resist overengineering. The 2^n enumeration is the intended solution; the plausible greedy is the trap.

Điểm kiểm tra β€” Định luαΊ­t n nhỏ. Given n ≀ 20 non-negative integers, print the maximum possible XOR of any non-empty subset. The arithmetic says 2^20 β‰ˆ 10^6 β€” brute force fits with huge margin. The greedy "take it if the XOR improves" is a well-known wrong answer: verify against the sample where it fails.