aboutsummaryrefslogtreecommitdiff
path: root/challenge-050/stuart-little/lua/ch-2.lua
blob: 3173bfbbf8f31ddc2e57e04b93e2b1bf3f0c7f10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env lua

-- run <script> <space-separated numbers>

local inpt={}
for _,v in ipairs(arg) do
   table.insert(inpt,tonumber(v))
end
table.sort(inpt)
for k,v in ipairs(inpt) do
   if v==#inpt-k and (k==#inpt or inpt[k+1]>v) then print(v) end
end