Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def countSumOfTwoRepresentations2(n, l, r)
- result = 0
- a = l
- while (a <= r)
- b = n - a
- if b >= 1 && b <= r && b >= a then
- result = result + 1
- end
- a = a + 1
- end
- return result
- end
Advertisement
Add Comment
Please, Sign In to add comment