Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
Untitled
a guest
Aug 14th, 2018
82
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
text
0.19 KB
| None
|
0
0
raw
download
clone
embed
print
report
def wow(arr,i)
if i == 0
return(arr[i].even? ? arr[i] : 0)
else
return(arr[i].even? ? arr[i]+wow(arr,i-1) : wow(arr,i-1))
end
end
a = [1,2,3,4,5,6,7]
print wow(a,a.length-1)
Add Comment
Please,
Sign In
to add comment
Public Pastes
Untitled
C# | 15 min ago | 4.76 KB
ImmortalHub v1.2
Lua | 24 min ago | 0.07 KB
Wayfire.ini_now
INI file | 31 min ago | 21.08 KB
🤑 G2A.com Free Gift Card Guide May 2024 FIX 🤑
GetText | 40 min ago | 0.38 KB
Code Example
Lua | 47 min ago | 8.95 KB
🤑 G2A.com Free Gift Card Guide May 2024 FIX 🤑
GetText | 47 min ago | 0.39 KB
Untitled
HTML | 1 hour ago | 0.32 KB
Untitled
C# | 1 hour ago | 9.58 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!