You are viewing a single comment's thread. Return to all comments →
We can also do:
defmodule ListLength do def main() do IO.read(:stdio, :all) |> String.split() |> Enum.map(&String.to_integer(&1)) |> list_length |> IO.puts end def list_length([_|tail]) do list_length(tail) + 1 end def list_length([]), do: 0 end ListLength.main
Seems like cookies are disabled on this browser, please enable them to open this website
List Length
You are viewing a single comment's thread. Return to all comments →
We can also do: