aboutsummaryrefslogtreecommitdiff
path: root/challenge-050/stuart-little/lua/ch-2.lua
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-050/stuart-little/lua/ch-2.lua')
-rwxr-xr-xchallenge-050/stuart-little/lua/ch-2.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-050/stuart-little/lua/ch-2.lua b/challenge-050/stuart-little/lua/ch-2.lua
new file mode 100755
index 0000000000..3173bfbbf8
--- /dev/null
+++ b/challenge-050/stuart-little/lua/ch-2.lua
@@ -0,0 +1,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