Created
March 3, 2022 13:06
-
-
Save joriki/6c73c579192f7e553b7061e124917209 to your computer and use it in GitHub Desktop.
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 Question4395079 { | |
public static void main (String [] args) { | |
int sum = 0; | |
outer: | |
for (int i = 1;i <= 99999;i++) { | |
int bits = 0; | |
for (char c : String.valueOf(i).toCharArray()) { | |
int mask = 1 << (c - '0'); | |
if ((bits & mask) != 0) | |
continue outer; | |
bits |= mask; | |
} | |
sum += i; | |
} | |
System.out.println("sum : " + sum); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment