일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- docker
- GCP mysql
- python
- 코테
- 파이서닉
- 공백Trim
- 디비설치
- docker-compose
- 차이
- 도커 에어플로
- 이직 3개월차
- Codility
- s3목록
- cyclerotation
- 답안지표기잘못한느낌...
- import from 차이점
- 1000개 이상
- 파이써닉
- Binary_gap
- 공백null치환
- 데이터카탈로그
- airflow설치
- Glue
- 프로그래머스
- 맞출수있었는데...
- Glue의 두 가지 핵심 기능
- 공백트림
- docker airflow
- AWS
- 코딩테스트
- Today
- Total
목록코딩테스트/Codility (9)
작은하마
https://app.codility.com/programmers/lessons/4-counting_elements/perm_check/ PermCheck coding task - Learn to Code - Codility Check whether array A is a permutation. app.codility.com def solution(A): A=sorted(A) if A[0]!=1: return 0 else: for i in range(len(A)-1): if A[i]+1!=A[i+1]: return 0 else : continue return 1
최근에 문자열, 숫자를 받아오면 인접한것끼리 제거하는 문제를 많이 풀었다. 처음에는 버블정렬마냥 하나를 기준으로 비교를 해야하나 고민하다가 스택을 이용하여 하는 방법을 참고하여 작성한다. S="AAGBBAACOOOAACDDD" 가 주어졌을경우 최종적으로 S="GOOD"가 나와야하는게 정상 # you can write to stdout for debugging purposes, e.g. # print("this is a debug message") def solution(S): S=list(S) answer=[] for i in S: if answer: if answer[-1]==i: answer.pop() else : answer.append(i) else : answer.append(i) if answ..
https://app.codility.com/programmers/lessons/3-time_complexity/frog_jmp/ FrogJmp coding task - Learn to Code - Codility Count minimal number of jumps from position X to Y. app.codility.com 처음에 while문으로 했지만 시간복잡도가 0점이 나왔다.. count=0 while True: x+=d count+=1 if x>=y: break count 그래서 아래것으로 바꾸어 풀어보았다. # you can write to stdout for debugging purposes, e.g. # print("this is a debug message") import ma..
https://app.codility.com/programmers/lessons/2-arrays/odd_occurrences_in_array/start/ Codility Your browser is not supported You should use a supported browser. Read more app.codility.com 배열 A가 주어졌을때 짝이 맞지 않는 수를 반환하는 문제이다. 배열에서 하나의 숫자 빼고는 다 짝이 맞도록 설정이되어있다. st=list(set(a)) for i in st: cnt=a.count(i) if cnt==1: answer=i answer 처음에 이런식으로 접근을 하였는데 55점이 나왔다. 이유는 O(n**2) 시간복잡도가 만족하지 않은것...
하...마지막에 and를 or로 바꿨어야했는데.. n = len(A) for i in range(n-1): if (A[i] + 1 < A[i + 1]): return False if (A[0] != 1 or A[n-1] < K): return False else: return True
1~50000사이의 임의의 숫자 N이 주어진다. N이 주어지면 이 숫자보다 큰 숫자중에 각 자리수 합이 일치하는 숫자를 찾는 문제 Ex) 123이 주어졌을때 각 자리 숫자의 합은 1+2+3=6이다 123보다 크면서 각 자리 숫자가 6이되는 첫 숫자는 132이다. 나는 이걸 map을 써서 풀었다. 숫자는 리스트로 저장할 때 각 자리 숫자로 저장이 안되기 떄문이다. 참고로 map함수는 '리스트'의요소를 지정된 함수로 저장해주는 함수이다. n=123 comp=sum(list(map(int,str(n)))) while n
https://app.codility.com/programmers/lessons/2-arrays/cyclic_rotation/ CyclicRotation coding task - Learn to Code - Codility Rotate an array to the right by a given number of steps. app.codility.com # you can write to stdout for debugging purposes, e.g. # print("this is a debug message") def solution(A, K): answer=[] if len(A)==0: answer=A elif K==0 or K%len(A)==0 or len(A)==K : answer=A else: K..
https://app.codility.com/programmers/trainings/1/longest_password/ LongestPassword coding task - Practice Coding - Codility Given a string containing words, find the longest word that satisfies specific conditions. app.codility.com 이문제는 isalnum()의 사용과 문자, 숫자 추출을 가능케하는 re.findall을 이용하면 쉽게 풀 수 있었다. 문론 나보다 잘 푸는 사람도 많다. import re s='te$##st 5 a0A pass007 ?xy1' s=s.split(' ') max=-1 for i in s: if i...
https://app.codility.com/demo/results/trainingJCD5A7-MFN/ Test results - Codility A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N. For example, number 9 has binary representation 1001 and contains a binary gap of length 2. The app.codility.com A binary gap within a positive integer N i..