코딩공부 221

[프로그래머스]Lv.1 두 개 뽑아서 더하기 C#

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

※[프로그래머스]Lv.1 내적 C# (select((s,idx)), zip)

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

[프로그래머스]Lv.1 음양 더하기 C# (select((s,idx)))

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

[프로그래머스]Lv.1 로또의 최고 순위와 최저 순위 C#

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

[프로그래머스]Lv.1 약수의 개수와 덧셈 C#

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

[프로그래머스]Lv.1 숫자 문자열과 영단어 C#

https://school.programmers.co.kr/learn/courses/30/lessons/81301 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드 using System; using System.Collections.Generic; public class Solution { public int solution(string s) { string[] strNum = new string[10] { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine",..

[프로그래머스]Lv.1 없는 숫자 더하기 C#(Except, Sum)

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

[프로그래머스]Lv.1 최소직사각형 C#

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

[프로그래머스]Lv.1 나머지가 1이 되는 수 찾기 C#

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

※[프로그래머스]Lv.1 신고 결과 받기 C#

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