Infinite Integer Intervals
mohayemin opened this issue · 0 comments
mohayemin commented
Related Problems
#24 is prerequisite of this problem. Please do not read this problem before attempting that one.
Overview
We discussed finite intervals in #24. Now is the time to implement infinite intervals.
[−∞,b]
contains all numbers less than or equal to b.[−∞,b[
contains all numbers less than b.[a,+∞]
contains all numbers greater than or equal to a.]a,+∞]
contains all numbers greater than a.
Examples
[−∞,5]
contains 2, 3, 5, -10 and -345.]2,+∞]
does not contain 2, contains 3, 5 and 1 million.
Task
Implement Infinite Integer Intervals
Note
[−∞,b]
and ]−∞,b]
are two different intervals. But that is not applicable for integers in a programming language which is finite.
Source
Reminders
- React to the problem if you find it interesting and helpful. This will help others to easily identify good problems to solve.
- Feel free to comment about the problem. Is the description unclear? Do you think it is too easy or too difficult than what is mentioned? Comment about it.
- Discussion about the solution is OK. But do not paste a solution here. Give a link to the solution instead.
- Do you have an interesting problem? Post it.