목록Algorithm (80)
Try
출처https://programmers.co.kr/learn/courses/30/lessons/49993?language=python3 소스1234567891011121314151617181920212223242526272829303132def solution(skill, skill_trees): answer = 0 flag = 1 cnt = 0 check = 0 trlen = 0 sklen = 0 trlen = len(skill_trees) for i in range (0, trlen): com = "" com = skill_trees[i] sklen = len(com) for j in range (0, sklen): nDelimiter = 0 nDelimiter = skill.find(com[j]) ..
출처https://programmers.co.kr/learn/courses/30/lessons/49993?language=cpp# 소스123456789101112131415161718192021222324252627282930313233343536#include #include using namespace std; int solution(string skill, vector skill_trees) { int answer = 0; int flag = 1; int cnt = 0; int check = 0; for(int i = 0; i
출처https://programmers.co.kr/learn/courses/30/lessons/12987?language=python3 소스12345678910111213141516171819def solution(A, B): answer = 0 A.sort() B.sort() length = len(A) res1 = 0 k = 0 for i in range (0, length): for j in range(k, length): if (A[i]
출처https://programmers.co.kr/learn/courses/30/lessons/12987 소스12345678910111213141516171819202122232425#include #include #include using namespace std; int solution(vector A, vector B) { int answer = 0; sort(A.begin(), A.end()); sort(B.begin(), B.end()); int res1 = 0; int k = 0; for(int i = 0; i
출처https://programmers.co.kr/learn/courses/30/lessons/42886?language=python3 소스 123456789101112131415def solution(w): answer = 0 sum = 0 length = 0 length = len(w) w.sort() for i in range (0, length): if (sum + 1 >= w[i]): sum = sum + w[i] else: break answer = sum + 1 return answercs
출처https://programmers.co.kr/learn/courses/30/lessons/42886?language=cpp 소스 123456789101112131415161718192021#include #include using namespace std; int solution(vector w){ int answer, sum = 0; sort(w.begin(), w.end()); for(int i = 0; i = w[i]){ sum = sum + w[i]; } else{ break; } } return answer = sum + 1;}Colored by Color Scriptercs
출처https://programmers.co.kr/learn/courses/30/lessons/43104?language=python3 소스 1234567891011121314def solution(N): answer = 0 a1 = 1 a2 = 1 a3 = 0 if N == 1: return 4 else: for i in range(2, N): a3 = a1+a2 a1 = a2 a2 = a3 return (a1+a2+a2)*2cs
출처https://programmers.co.kr/learn/courses/30/lessons/43104 소스 123456789101112131415161718192021222324#include #include using namespace std; long long solution(int N) { long long a1 = 1; long long a2 = 1; long long a3 = 0; long long answer = 0; long long sum = 0; if (N ==1){ return 4; } else{ for(long long i = 2; i
출처https://programmers.co.kr/learn/courses/30/lessons/42883?language=python3 소스 123456789101112131415161718192021222324252627282930313233def solution(number, k): answer = '' length = 0 length = len(number) cnt = 0 slen = 0 slen = k flag = 0 k = length - k while(1): for j in range (0, length): for m in range (1, slen+1): if number[j] >= number[j+m]: continue else: flag = 1 if flag: break if flag: ..
출처 https://programmers.co.kr/learn/courses/30/lessons/42883 소스 12345678910111213141516171819202122232425262728293031323334353637383940414243444546#include #include using namespace std; string solution(string number, int k) { string answer = ""; int length = 0; length = number.length(); int cnt = 0; int len = k; int flag = 0; k = length - k; while(1){ for(int j = 0; j = k){ return answer; } } } r..