Skip to content

Instantly share code, notes, and snippets.

@alexzam
Last active May 28, 2021 14:30
Show Gist options
  • Save alexzam/93924a8ced0684a24e921ce6deb07f32 to your computer and use it in GitHub Desktop.
Save alexzam/93924a8ced0684a24e921ce6deb07f32 to your computer and use it in GitHub Desktop.
for(int i = 0; i < arr.length; i++){
long number = arr[i];
int[] digits = new int[6];
for(int j = 0; j < 6; j++){
digits[i] = number % 10;
number = number / 10;
}
arr[i] = (digits[0] + digits[5]) * 10000
+ (digits[1] + digits[4]) * 100
+ (digits[2] + digits[3]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment