Skip to content

Instantly share code, notes, and snippets.

@hatone
Created February 7, 2014 01:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hatone/8855949 to your computer and use it in GitHub Desktop.
Save hatone/8855949 to your computer and use it in GitHub Desktop.
SRM607 DIV2 250
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