//Topcoder SRM 574 DIV 2 L1 CityMap
import java.util.*;
import java.math.*;
import javax.crypto.spec.PSource;
public class CityMap {
public static void main(String[] args) {
System.out.println(
//
new CityMap().getLegend(
new String[]
{},
new int[]
{}
));
}
public String getLegend(String[] cityMap, int[] POIs) {
int[] nchar = new int[26];
for (int i = 0; i < cityMap.length; i++) {
for (int j = 0; j < cityMap[i].length(); j++) {
char c = cityMap[i].charAt(j);
if (c != '.') {
nchar[c - 'A'] += 1;
}
}
}
String s = "";
for (int i = 0; i < POIs.length; i++) {
for (int j = 0; j < nchar.length; j++) {
if (POIs[i] == nchar[j]) {
char c = (char) ('A' + j);
s += String.valueOf(c);
}
}
}
return s;
}
}
No comments:
Post a Comment