Guest User

Untitled

a guest
Feb 20th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. def search(v,a)
  2. return if a.empty?
  3. if a.pop == v
  4. return search(v,a) + 1 rescue 1
  5. else
  6. return search(v,a) + 0 rescue 0
  7. end
  8. end
  9.  
  10. search(1,[1,2,3,4,3,4,4,4,1,1,4])
Add Comment
Please, Sign In to add comment