목록프로그래머스 (2)
elesis's haunt
프로그래머스 레벨1) 신규 아이디 추천
class Solution { public String solution(String new_id) { String word = new_id; String result = ""; //1 word = word.toLowerCase(); //2 word = word.replaceAll("\\~|\\!|\\@|\\#|\\$|\\%|\\^|\\&|\\*|\\(|\\)|\\=|\\+|\\[|\\{|\\]|\\}|\\:|\\?|\\,|\\|\\/", ""); //3 word = word.replaceAll("\\.+", "."); //4 word = word.replaceAll("^\\.", ""); word = word.replaceAll("\\.$", ""); //5 if(word.length()==0) word..
프로그래머스/LEVEL_1
2021. 9. 8. 15:25
프로그래머스 레벨1) 로또의 최고 순위와 최저 순위
class Solution { public int[] solution(int[] lottos, int[] win_nums) { int cnt = 0; int random = 0; int min = 0; int max = 0; for(int i=0;i w == l) || l == 0).count(), (lottos.length + 1) - Arrays.stream(lottos).filter(l -> Arrays.stream(winNums).anyMatch(w -> w == l)).count() ) .mapToInt(op -> (int) (op > 6 ? op - 1 : op)) .toArray(); } }
프로그래머스/LEVEL_1
2021. 9. 3. 15:16