Logo
MainBooksThoughtsAbout

Patterns

Elixir solutions

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

LeetCode 3870 Elixir solution

LeetCode 3870 Count Commas in Range solution in Elixir. The easy solution with the O(1) time and space complexities implemented in Elixir.

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

© 2026 Algobytes

Privaci Policy