Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def commonPoints(l1, r1, l2, r2)
- max = [l1, r1, l2, r2].max
- sum = 0
- x = -10
- while (x <= max)
- if l1 < x and x < r1 and l2 < x and x < r2 then
- sum = sum + 1
- end
- x = x + 1
- end
- return sum
- end
Advertisement
Add Comment
Please, Sign In to add comment