Nullbody Notes
Nov 20, 2023 · Fundamentals
Counting Valid Triangles: Why Reverse Traversal Matters
The article explains how to count the number of valid triangles that can be formed from an integer array by first sorting the array and then using a reverse‑order two‑pointer technique, detailing each step and providing a complete Go implementation.
algorithmsortingtriangles
0 likes · 3 min read
