class Solution { public String solution(String new_id) { String answer = ""; new_id = new_id.toLowerCase(); String[] str = new_id.split(""); String alphabet = "abcdefghijklnmopqrstuvwxyz.-_1234567890"; for (String s : str) { if (alphabet.contains(s)) { answer += s; } } String tmp = answer; answer = ""; tmp = tmp.replace("..", "."); while (tmp.contains("..")) { tmp = tmp.replace("..", "."); } if(..