Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
varnie committed Feb 26, 2025
1 parent d2c654c commit 0f73c54
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions lib/challenge55.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,10 @@ defmodule Challenge55 do
etc......
"""

# TODO: buggy
def cbal_tree(count) do
cond do
count == 0 ->
[nil]

count == 1 ->
[%TreeNode{symbol: :x, left: nil, right: nil}]
def cbal_tree(count) when count == 0, do: [nil]

true ->
cbal_tree_helper(cbal_tree(count - 1))
end
def cbal_tree(count) do
cbal_tree_helper(cbal_tree(count - 1))
end

defp cbal_tree_helper(nodes_list) do
Expand Down

0 comments on commit 0f73c54

Please sign in to comment.