코딩공부/프로그래머스 191

※[프로그래머스]Lv.2 모음 사전 C#(순열)

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

※[프로그래머스]Lv.2 피로도 C#(순열)

https://school.programmers.co.kr/learn/courses/30/lessons/87946 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드 미뤄두고 있던 순열을 공부하기에 좋았던 문제였다. using System; using System.Collections.Generic; public class Solution { List list = new List(); public int solution(int k, int[,] dungeons) { int answer = -1; int size = dungeons.GetLength(0..

[프로그래머스]Lv.2 주차 요금 계산 C#

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

[프로그래머스]Lv.2 두 큐 합 같게 만들기 C#

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

[프로그래머스]Lv.2 할인 행사 C#

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

※[프로그래머스]Lv.2 롤케이크 자르기C# (순차적으로 줄여나가기)

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

※[프로그래머스]Lv.2 귤 고르기C# (Dictionary.TryAdd 중복 카운터)

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

※[프로그래머스]Lv.2 숫자 변환하기 C# (Hashset)

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

※[프로그래머스]Lv.2 뒤에 있는 큰 수 찾기 C# (시간복잡도오류, 스택)

https://school.programmers.co.kr/learn/courses/30/lessons/154539 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드 뒤에있는 숫자를 구할 때는 스택을 사용하는게 편리하다. using System; using System.Collections.Generic; using System.Linq; public class Solution { public int[] solution(int[] numbers) { int[] answer = new int[numbers.Length]; Array.Fill(answe..

[프로그래머스]Lv.2 무인도 여행 C#(BFS)

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