Algorithm/프로그래머스
2023.06.15
import java.util.Arrays; class Solution { public int solution(int[] num_list, int n) { return Arrays.stream(num_list).anyMatch(s -> s == n) ? 1 : 0; } } 다른 사람의 풀이 import java.util.stream.IntStream; class Solution { public int solution(int[] numList, int n) { return IntStream.of(numList).anyMatch(num -> num == n) ? 1 : 0; } }
Algorithm/프로그래머스
2023.06.14
import java.util.Arrays; import java.util.stream.Collectors; class Solution { public String solution(String[] str_list, String ex) { return Arrays.asList(str_list).stream() .filter(s -> !s.contains(ex)) .collect(Collectors.joining()); } }
Algorithm/프로그래머스
2023.06.13
class Solution { public int solution(String str1, String str2) { return str2.contains(str1) ? 1 : 0; } }
Algorithm/프로그래머스
2023.06.13
class Solution { public int solution(String my_string, String target) { return my_string.contains(target) ? 1 : 0; } }
Algorithm/프로그래머스
2023.06.13
class Solution { public String solution(int n) { return String.valueOf(n); } }
Algorithm/프로그래머스
2023.06.13
class Solution { public int solution(String n_str) { return Integer.parseInt(n_str); } }
Algorithm/프로그래머스
2023.06.12
class Solution { public String solution(String n_str) { return String.valueOf(Integer.parseInt(n_str)); } }
Algorithm/프로그래머스
2023.06.12
class Solution { public int solution(double flo) { return (int) flo; } }