Logo
MainBooksThoughtsAbout

Patterns

Elixir solutions

2265 LeetCode problem solution

LeetCode 2265 problem is a good example of DFS with postorder traversal. For each node, we calculate the sum and number of nodes in its subtree.

Read more

4000 LeetCode problem solution

LeetCode 4000 Largest Integer With Given Digit Sum is a simple greedy problem. To build the largest possible number, we place the largest digits first while keeping the required digit sum.

Read more

LeetCode 3870 & 3871: from a simple to a general solution

LeetCode 3870 and 3871 problems look almost the same, but the larger constraints change the solution. This is a good example of why you should always ask about the problem constraints.

Read more

LeetCode 3871 Elixir solution

LeetCode 3871 Count Commas in Range II solution in Elixir. In this solution the recursion replaces the C++ loop. Since it uses tail recursion, the Elixir/Erlang VM can execute it without accumulating stack frames.

Read more

3871 LeetCode daily problem solution

LeetCode 3871 Count Commas in Range II solution. It extends the 3870 problem to much larger numbers. Instead of counting numbers, we count each comma level separately in O(log n) time. But for the given constraints, the algorithm performs at most five iterations and O(1) time.

Read more
PreviousPage 9 of 11Next
☕Support AlgoBytes on Patreon

© 2026 Algobytes

Privaci Policy