Alternate Priorities
summary
Reduces an implementation that computes the maximum horizontal or vertical distance between points from 214 bytes to 87 bytes. Changes the algorithm to a brute‑force O(n^2) pairwise scan, removes const/ref and abs, uses one-character names, counts backwards, and collapses loop bodies with the comma operator to drop braces and semicolons. The result compiles and still produces the correct distance while prioritizing minimal source size.
AI-written summary · about
chapters (5)
- 0:00Introduction to code golf
- 1:11The initial problem
- 2:25Basic code golfing techniques
- 3:27Algorithmic optimization
- 4:27Advanced reduction techniques
related talks
01h 05mThink Parallel
01h 00mMoving Faster: Everyday efficiency in modern C++
01h 04mBetter Code: Data Structures
01h 35mThe Twin Algorithms
57mAliasing: Risks, Opportunities and Techniques
05mMaximising Throughput & Minimising Latency in High-Performance C++ Code
49mAn Engineering Approach to Optimising C++
47mOptimizing Multithreading Performance
