Advertisement
Guest User

Untitled

a guest
Aug 14th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.24 KB | None | 0 0
  1. def check_exam(arr1, arr2)
  2.   sum = 0
  3.   arr1.each_with_index do |a, i|
  4.     sum += if a == arr2[i]
  5.              4
  6.            elsif a == ''
  7.              0
  8.            else
  9.              1
  10.            end
  11.   end
  12.   sum = 0 if sum < 0
  13.   sum
  14. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement