Skip to content

Instantly share code, notes, and snippets.

@linnykoleh
Last active June 14, 2023 10:02
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 linnykoleh/5b702c4c3b8336054818ed7c97c7acb1 to your computer and use it in GitHub Desktop.
Save linnykoleh/5b702c4c3b8336054818ed7c97c7acb1 to your computer and use it in GitHub Desktop.
public class SpeedUpTheCodePicture {
public static void main(String[] args) {
checkPicture();
}
static boolean checkPicture() {
int n = 4096, count = 0;
var image = new byte[n][n];
for (int r = 0; r < n; r++) {
for (int c = 0; c < n; c++) {
count += (image[r][c] & 0xFF) >>> 7;
}
}
return count < n * n / 2;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment