import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.HashMap; import java.util.Map; public class goodStrings { public static void main(String[] args) throws IOException { Map<String, Integer> map = new HashMap<>(); BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = br.readLine(); int n = Integer.parseInt(line); int res = 0; for(int i = 0; i < n; i++) { String str = br.readLine(); char[] t = str.toCharArray(); System.out.println(t); Arrays.sort(t); str = new String(t); map.put(str, map.getOrDefault(str, 0) + 1); res = Math.max(res, map.get(str)); } System.out.println(res); } }
点赞 评论

相关推荐

点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务