Created
February 7, 2014 01:30
-
-
Save hatone/8855949 to your computer and use it in GitHub Desktop.
SRM607 DIV2 250
This file contains 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 class BoundingBox { | |
public int smallestArea(int[] X, int[] Y) { | |
return getl(X)*getl(Y); | |
} | |
private int getl(int[] N) { | |
int max = -100; | |
int min = 100; | |
for (int i=0; i<N.length; i++){ | |
max = Math.max(max,N[i]); | |
min = Math.min(min,N[i]); | |
} | |
return max-min; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment