Logo
MainBooksThoughtsAbout

Patterns

Elixir solutions

LeetCode 940 Dynamic Programming Solution After LeetCode 115

LeetCode 940 solution using Dynamic Programming with Last Occurrence and Deduplication to count distinct subsequences efficiently in O(n) time and O(1) space.

Read more

LeetCode 115: two solutions - Space optimization using a 1D array

See how a simple 1D array optimization reduces space complexity from O(n * m) to O(m) while keeping O(n * m) time complexity.

Read more
Page 1 of 1
☕Support AlgoBytes on Patreon

© 2026 Algobytes

Privaci Policy