Java Tech Enthusiast
Dec 26, 2024 · Fundamentals
LeetCode 491 – Non-decreasing Subsequences (Algorithm Explanation and Multi-language Solutions)
The article explains LeetCode 491, requiring all non‑decreasing subsequences of length ≥2 from an integer array, and details a depth‑first search approach that uses a per‑level set to skip duplicates, with complete example implementations in Java, C++, C, and Python.
C++DFSJava
0 likes · 7 min read