분류 전체보기 504

[프로그래머스]Lv.2 행렬의 곱셈 C#

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

[프로그래머스]Lv.2 JadenCase 문자열 만들기 C#

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

[프로그래머스]Lv.2 피보나치 수 C#(재귀)

https://school.programmers.co.kr/learn/courses/30/lessons/12945 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드1( 재귀 사용 시간복잡도 오류) public class Solution { public int solution(int n) { return fibonacci(n); } int fibonacci(int n) { if (n

[프로그래머스]Lv.2 최댓값과 최솟값 C#(문자배열 to 정수배열 변환 링큐)

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

[프로그래머스]Lv.2 다음 큰 숫자 C#

https://school.programmers.co.kr/learn/courses/30/lessons/12911 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드1(시간복잡도 오류) using System; using System.Linq; class Solution { public int solution(int n) { int nBinary = Convert.ToString(n, 2).Where(s=>s == '1').Count(); while (true) { int nextBinary = Convert.ToString(++n, 2).Where(..

[프로그래머스]Lv.2 최솟값 만들기 C#

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

[프로그래머스]Lv.2 올바른 괄호 C#

https://school.programmers.co.kr/learn/courses/30/lessons/12909 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드 using System; public class Solution { public bool solution(string s) { int count = 0; if (s[0] == ')') return false; foreach (char c in s) { if (c == '(') count++; else count--; if (count < 0) return false; } return co..

[프로그래머스]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..