코딩공부 221

[프로그래머스]Lv.1 제일 작은 수 제거하기 C# (링큐)

https://school.programmers.co.kr/learn/courses/30/lessons/12935 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드1 using System; using System.Collections.Generic; using System.Linq; public class Solution { public int[] solution(int[] arr) { List answer = arr.ToList(); int min = answer.Min(); answer.Remove(min); if (answer.Count < ..

[프로그래머스]Lv.1 평균 구하기 C# (Average)

https://school.programmers.co.kr/learn/courses/30/lessons/12944 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드1 using System.Linq; public class Solution { public double solution(int[] arr) { int sum = arr.Sum(); return (double)sum / (double)arr.Length; } } 소스코드2 using System.Linq; public class Solution { public double solution(..

[프로그래머스]Lv.1 핸드폰 번호 가리기 C#(padLeft)

https://school.programmers.co.kr/learn/courses/30/lessons/12948 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드1 public class Solution { public string solution(string phone_number) { string answer = ""; char[] array = phone_number.ToCharArray(); for (int i = 0; i < phone_number.Length - 4; i++) { array[i] = '*'; } return new str..

[프로그래머스]Lv.1 x만큼 간격이 있는 n개의 숫자 C#(반복간격공식)

https://school.programmers.co.kr/learn/courses/30/lessons/12954 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드 public class Solution { public long[] solution(int x, int n) { long[] answer = new long[n]; for (int i = 0; i < n; i++) { if (i != 0) answer[i] = answer[i - 1] + x; else answer[i] = x; } return answer; } }

[프로그래머스]Lv.1 직사각형 별찍기 C#

https://school.programmers.co.kr/learn/courses/30/lessons/12969 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드 using System; public class Example { public static void Main() { String[] s; Console.Clear(); s = Console.ReadLine().Split(' '); int a = Int32.Parse(s[0]); int b = Int32.Parse(s[1]); for (int i = 0; i < b; i++) { for (..

[프로그래머스]Lv.1 소수 만들기 C# (소수인지 확인)

https://school.programmers.co.kr/learn/courses/30/lessons/12977 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드 using System; class Solution { public int solution(int[] nums) { int answer = 0; for (int i = 0; i < nums.Length; i++) { for (int j = i + 1; j < nums.Length; j++) { for (int k = j + 1; k < nums.Length; k++) { int sum =..

[프로그래머스]Lv.1 예산 C#

https://school.programmers.co.kr/learn/courses/30/lessons/12982 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드 using System; public class Solution { public int solution(int[] d, int budget) { int answer = 0; Array.Sort(d); int sum = 0; foreach (int i in d) { sum += i; if (budget < sum) break; if (budget == sum) { answer++; brea..

[프로그래머스]Lv.1 K번째수 C#

https://school.programmers.co.kr/learn/courses/30/lessons/42748 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드 using System; public class Solution { public int[] solution(int[] array, int[,] commands) { int[] answer = new int[commands.GetLength(0)]; for (int a = 0; a < commands.GetLength(0); a++) { int i = commands[a, 0] - 1; i..

※[프로그래머스]Lv.1 모의고사 C# (나머지 값 활용)

https://school.programmers.co.kr/learn/courses/30/lessons/42840 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드 using System; using System.Collections.Generic; using System.Linq; public class Solution { public int[] solution(int[] answers) { int[] first = new int[] { 1, 2, 3, 4, 5 }; int[] second = new int[] { 2, 1, 2, 3, 2, 4, ..

※[프로그래머스]Lv.1 체육복 C#(except)

https://school.programmers.co.kr/learn/courses/30/lessons/42862 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드 using System; using System.Linq; public class Solution { public int solution(int n, int[] lost, int[] reserve) { int answer = 0; int[] excpReserve = reserve.Except(lost).Select(x => x).ToArray(); int[] excpLost = lost...