코딩공부 221

[프로그래머스]Lv.0 A 강조하기 C#(Replace)

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

[프로그래머스]Lv.0 길이에 따른 연산 C#(list.Aggregate)

https://school.programmers.co.kr/learn/courses/30/lessons/181879 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드 using System; using System.Linq; public class Solution { public int solution(int[] num_list) { int answer = 0; if (num_list.Length >= 11) answer = num_list.Sum(); else answer = num_list.Aggregate((cur, next) => cur * ..

[프로그래머스]Lv.0 1로 만들기 C#

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

※[프로그래머스]Lv.0 조건에 맞게 수열 변환하기 2 C# (SequenceEqual)

https://school.programmers.co.kr/learn/courses/30/lessons/181881?language=csharp 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드 using System; using System.Collections.Generic; using System.Linq; public class Solution { public int solution(int[] arr) { int min = 0; while (true) { int[] temp = new int[arr.Length]; Array.Copy(arr,..

[프로그래머스]Lv.0 왼쪽 오른쪽 C# (Array.IndexOf, skip, take)

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

[프로그래머스]Lv.0 순서 바꾸기 C# (Array.Copy, skip, take)

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

[프로그래머스]Lv.0 n 번째 원소부터 C# (Skip)

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

[프로그래머스]Lv.0 배열 조각하기 C# (RemoveRange, Take, Skip)

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

[프로그래머스]Lv.0 2의 영역 3 C#

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

[프로그래머스]Lv.0 배열 만들기 3 C# (linq 포함)

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