글
프로그래머스 C# 제일 작은 수 제거하기(array.where)
프로그래밍
2023. 1. 23. 15:33
728x90
SMALL
using System;
using System.Linq;
public class Solution {
public int[] solution(int[] arr) {
int min = arr.Min();
int[] answer = arr.Length < 2 ? new int[1]{-1} : arr.Where(x => x != min).ToArray();
return answer;
}
}
/// {-1}
728x90
'프로그래밍' 카테고리의 다른 글
프로그래머스 C# 최대공약수와 최소공배수(for문) (0) | 2023.01.23 |
---|---|
C# 최댓값과 최솟값(Split().Select(x => ), OrderBy, ToList()) (0) | 2023.01.23 |
프로그래머스 C# 평균 구하기(double) (0) | 2023.01.23 |
프로그래머스 C# 이상한 문자 만들기(Split, 공백 처리) (0) | 2023.01.23 |
프로그래머스 C# 핸드폰 번호 가리기(for문 안에 if문, 길이-4) (0) | 2023.01.23 |