From 7ddfbd02b89c453f8f84727132d2d57eeec8a36e Mon Sep 17 00:00:00 2001 From: HVukman Date: Sun, 7 Sep 2025 21:23:51 +0200 Subject: Create 337_p1.lua --- challenge-337/hvukman/lua/337_p1.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 challenge-337/hvukman/lua/337_p1.lua diff --git a/challenge-337/hvukman/lua/337_p1.lua b/challenge-337/hvukman/lua/337_p1.lua new file mode 100644 index 0000000000..1277d8c1d8 --- /dev/null +++ b/challenge-337/hvukman/lua/337_p1.lua @@ -0,0 +1,19 @@ +local inputs = { {6, 5, 4, 8},{7,7,7,7},{5, 4, 3, 2, 1}, + {-1, 0, 3, -2, 1},{0, 1, 1, 2, 0} } + +function Smaller(X) + for i,v in ipairs(X) do + local int = 0 + for j,w in ipairs(X) do + if v>= w and i~=j then + int = int +1 + end + end + io.write(int," ") + end + io.write("\n") +end + +for i=1,#inputs do + Smaller(inputs[i]) +end -- cgit