Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def check_exam(arr1, arr2)
- sum = 0
- 0.upto(arr1.length - 1) do |i|
- sum += if arr1[i] == arr2[i]
- 4
- elsif arr2[i].empty?
- 0
- else
- -1
- end
- end
- if sum < 0
- 0
- else
- sum
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement