Algorithm/프로그래머스

Algorithm/프로그래머스

[알고리즘] 정수 찾기 Java

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/프로그래머스

[알고리즘] 꼬리 문자열 Java

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/프로그래머스

[알고리즘] 부분 문자열 Java

class Solution { public int solution(String str1, String str2) { return str2.contains(str1) ? 1 : 0; } }

Algorithm/프로그래머스

[알고리즘] 부분 문자열인지 확인하기 Java

class Solution { public int solution(String my_string, String target) { return my_string.contains(target) ? 1 : 0; } }

Algorithm/프로그래머스

[알고리즘] 문자열로 변환 Java

class Solution { public String solution(int n) { return String.valueOf(n); } }

Algorithm/프로그래머스

[알고리즘] 문자열을 정수로 변환하기 Java

class Solution { public int solution(String n_str) { return Integer.parseInt(n_str); } }

Algorithm/프로그래머스

[프로그래머스] 0 떼기 Java

class Solution { public String solution(String n_str) { return String.valueOf(Integer.parseInt(n_str)); } }

Algorithm/프로그래머스

[알고리즘] 정수 부분 Java

class Solution { public int solution(double flo) { return (int) flo; } }

rw-
'Algorithm/프로그래머스' 카테고리의 글 목록 (6 Page)