Last active
July 30, 2018 17:55
-
-
Save Europia79/e5111c790ef67c07f1574564e19892b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean in3050(int a, int b) { | |
Range range3 = new Range(30, 40); | |
Range range4 = new Range(40, 50); | |
return range3.contains(a,b) || range4.contains(a,b); | |
} | |
class Range { | |
int min; | |
int max; | |
public Range(int min, int max) { | |
this.min = min; | |
this.max = max; | |
} | |
public contains(int x, int y) { | |
return contains(x) && contains(y); | |
} | |
public contains(int x) { | |
return x >= min && x <= max; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solution: