코딜리티

Algorithm

[codility] Lesson 3 | TapeEquilibrium - 파이썬(Python) | Time Complexity

https://app.codility.com/programmers/lessons/3-time_complexity/ 3. Time Complexity lesson - Learn to Code - Codility Count minimal number of jumps from position X to Y. app.codility.com 코딜리티에서 lesson 3 시간 복잡도 문제를 풀었다. 이 문제가 이해하는데 가장 시간을 많이 쓴 것 같다.. 영어로 된 것도 있지만 이 문제를 효율적으로 풀어야 하는 나한테 요구하는게 뭔지 파악을 하기가 힘들었다. 문제 그대로 해석하면 p에 따라 리스트 A가 2개로 나뉘어진다. 첫번째 구간은 A[:P]이며 두번째 구간은 A[P:N-1]이다. 이 두 구간의 총 합의 차이를 구..

Algorithm

[codility] Lesson 3 | PermMissingElem - 파이썬(Python) | Time Complexity

https://app.codility.com/programmers/lessons/3-time_complexity/ 3. Time Complexity lesson - Learn to Code - Codility Count minimal number of jumps from position X to Y. app.codility.com 코딜리티 lesson 3 시간 복잡도에 관련된 문제를 풀었다. 리스트 A의 원소는 1부터 N+1까지의 수로 구성되어 있는데 이 중 하나의 숫자가 누락되어 있으며 이때 누락된 숫자를 찾는 문제이다. 첫번째 시도 - 실패 def solution(A): answer = '' A = sorted(A) for i in range(len(A) -1) : if A[i+1] - A[i] !=..

Algorithm

[codility] Lesson 3 | FrogJmp - 파이썬(Python) | Time Complexity

https://app.codility.com/programmers/lessons/3-time_complexity/ 3. Time Complexity lesson - Learn to Code - Codility Count minimal number of jumps from position X to Y. app.codility.com 코딜리티 lesson 3 시간 복잡도에 관련된 문제를 풀었다. x,y,d가 주어지고 개구리의 위치가 y와 같거나 클 때까지 x에 d를 몇번 더하면 되는지 푸는 문제이다. 시간 복잡도 문제이다 보니 확실히 효율성을 따져가면서 풀어야했다. lesson3에 있는 세 문제 모두 생각없이 문제흐름대로 풀었다가 전부 시간 초과를 마주했었다 ㅎ 첫번째 풀이 - 실패 def solution(..

Algorithm

[codility] Lesson 2 | CyclicRotation & Odd Occurrences In Array - 파이썬(Python) | Arrays

https://app.codility.com/programmers/lessons/2-arrays/ 2. Arrays lesson - Learn to Code - Codility Rotate an array to the right by a given number of steps. app.codility.com 코딜리티에서 lesson2에 있는 두 문제를 어제 오늘 풀었다. easy라고 되어 있는데 왜 난 쉽게 풀지 못했는가... CyclicRotation 주어진 배열 A의 원소들이 K만큼 배열 A안에서 회전을 하는 문제이다. 영어로 되어 있기 때문에 제한 사항을 잘 봐야했는데 나는 제한사항을 제대로 보지 않아서 처음엔 100%가 나오지 않았다. CyclicRotation 정답 코드 def solution(..

Algorithm

[codility] Lesson 1 | binary gap - 파이썬(Python) | Iterations

https://app.codility.com/programmers/lessons/1-iterations/ 1. Iterations lesson - Learn to Code - Codility Find longest sequence of zeros in binary representation of an integer. app.codility.com 곧 있을 코테가 코딜리티에서 진행된다고 하여 플랫폼에 익숙해 지기 위해 코딜리티에서 문제를 풀기 시작했다. 영어로 되어 있는 사이트라 문제도 영어라서 차근차근 읽어보고 제대로 코드를 짜는 것이 가장 중요할 것 같았다. lesson 1부터 코테 전까지 최대한 많이 풀어보려고 노력해야할 것 같다. 코딜리티의 lesson 1 문제는 아래와 같다. 10진수를 2진수로 ..

토오오끼
'코딜리티' 태그의 글 목록