Created
January 1, 2017 12:32
-
-
Save enif-lee/7bd8981f7ff9fa521b76f837cd4951eb 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
package problem.boj; | |
import java.util.Scanner; | |
/** | |
* Created by Jinseoung on 2017-01-01. | |
*/ | |
public class ValueToAnagram { | |
static Scanner sc = new Scanner(ClassLoader.getSystemResourceAsStream("problem/boj/ValueToAnagram.testcase")); | |
public static void main(String[] args) { | |
String s1 = sc.next(), | |
s2 = sc.next(); | |
int countValue = 0; | |
int[] charactors = new int[58]; | |
for(int i = 0; i < s1.length(); i++) { | |
charactors[s1.charAt(i)-'A']++; | |
} | |
for(int i = 0; i < s2.length(); i++) { | |
charactors[s2.charAt(i)-'A']--; | |
} | |
for(int i = 0; i < charactors.length; i++) countValue += Math.abs(charactors[i]); | |
System.out.println(countValue); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment