Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
missing element
--lua 5.3 A = {1,2,4,5} function printa(va) for i,v in ipairs(va) do io.write(v, ' ') end io.write('\n') end printa(A) function sum(va) local acc = 0 for i,v in ipairs(va) do acc = acc + v end return acc end function missing(va) local n = #va local lim = (n * (n + 1)) / 2 local t = sum(va) if(t == lim) then return -1 end print(lim) return (lim + va[#va]) - t end print(missing(A))
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
String Searcher
zzz
Truly random numbers (Lua)
PAID HACK PuBG
xml panel repeater
Creating habits. Lua
Area of Sector Calculator
PAID HACK PuBG
bf-asm compiler test 2
CC: LDInterface
Please log in to post a comment.