분류 전체보기 493

[프로그래머스]Lv.1 둘만의 암호C#

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

[프로그래머스]Lv.1 카드 뭉치 C#

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

※[프로그래머스]Lv.1 대충 만든 자판 C#

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

※[프로그래머스]Lv.1 덧칠하기 C#

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

※[프로그래머스]Lv.1 공원 산책 C#

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

※[프로그래머스]Lv.1 크기가 작은 부분문자열 C#(long.parse)

https://school.programmers.co.kr/learn/courses/30/lessons/147355 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 소스코드 형변환을 int.parse로 했다가 시간초 에러가 났다 알고 보니 제한사항에 1 ≤ p의 길이 ≤ 18을 생각하지 않고 int.parse로 해서 나는 오류였다. 제한사항을 잘 확인해 봐야겠다. using System; public class Solution { public int solution(string t, string p) { int answer = 0; long ip = lon..

※[프로그래머스]Lv.1 달리기 경주 C#(dictionary)

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

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