Assign the variable
"list" to a list with no elements
fantom list := [,]
class SolutionXX
{
Void main()
{
list := [,]
}
}
erlang List = [],
-module(emptylist).
-export([start/0]).
start() ->
List = [],
io:format("~B~n", [length(List)]).
Submit a new solution for
fantom or
erlang
There are 24 other solutions in
additional languages (
clojure,
cpp,
csharp,
fsharp ...)