Skip to content

Instantly share code, notes, and snippets.

@otaruMendez
Created February 23, 2019 20:52
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 otaruMendez/3e3a339cd5bf69a1ce6d9732ec6e471f to your computer and use it in GitHub Desktop.
Save otaruMendez/3e3a339cd5bf69a1ce6d9732ec6e471f to your computer and use it in GitHub Desktop.
The Pizza Class for Hashcode Pizza Question
public class Pizza {
int rows;
int cols;
int minIngredientEachPerSlice;
int maxCellsPerSlice;
HashMap<String, Cell> cells;
int rowLength;
int colLength;
public String getCellHashKey (int x, int y) {
return String.format("%0" + rowLength + "d", x) + String.format("%0" + colLength + "d", y);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment