분류 전체보기 516

[프로그래머스]Lv.2 게임 맵 최단거리 C#(BFS)

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

[프로그래머스]Lv.2 영어 끝말잇기 C#

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

[프로그래머스]Lv.2 다리를 지나는 트럭C#

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

[프로그래머스]Lv.2 주식가격C#

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

[프로그래머스]Lv.2 기능개발C#

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

※[프로그래머스]Lv.2 가장 큰 수C#(문자열 CompareTo 정렬, 시간복잡도 오류)

https://school.programmers.co.kr/learn/courses/30/lessons/42746 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 처음에 순열을 통하여 접근하는 방법을 생각했으나 시간복잡도 오류가 발생하였다. 문자열 비교를 통해 정렬 하여 문제를 해결하였다. 소스코드1(시간복잡도 오류) using System; using System.Collections.Generic; using System.Linq; using System.Text; public class Solution { List list = new List(); p..

[프로그래머스]Lv.2 프로세스C#

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

[프로그래머스]Lv.2 큰 수 만들기C#

https://school.programmers.co.kr/learn/courses/30/lessons/42883/solution_groups?language=csharp 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드 using System; using System.Text; public class Solution { public string solution(string number, int k) { int size = number.Length - k; int idx = 0; StringBuilder strArr = new StringBuilde..

※[프로그래머스]Lv.2 타겟 넘버C#

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

[프로그래머스]Lv.2 스킬트리C#

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