일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 파이썬 정렬
- icmp
- 쉽게 배우는 데이터 통신과 컴퓨터 네트워크
- 북클럽
- 자료형
- 노마드코더
- DP
- 시스템 소프트웨어
- 쿠키
- 컴퓨터 동작방식
- 파이썬 자료형
- 컴퓨터네트워크
- 데이터통신
- OSI7계층모델
- data type
- 라우팅
- 데이터 통신과 컴퓨터 네트워크
- 파이썬 연산자
- sort()
- 기억장치
- 이것이 취업을 위한 코딩테스트다
- 노개북
- 이코테
- IT5분잡학사전
- CS
- 이것이 취업을 위한 코딩 테스트다
- GIT
- RARP
- ARP
- 리스트
- Today
- Total
목록Algorithm & Data structure (27)
뚝딱햄 탈출기
내 풀이 첫번째 풀이 & 보완할 점 def solution(numbers): answer = [] for i in range(len(numbers)): answer.append(numbers[i] * 2) return answer 인덱스 값을 순서대로 호출하는 for문을 이용해 정수 배열 numbers의 각 원소에 접근하고, 각 원소에 2를 곱한 값을 answer 배열에 추가해야겠다고 생각했다. 그래서 len으로 리스트의 길이를 구하고, range에 넣어 0부터 len - 1까지의 인덱스로 numbers의 원소들을 구했다. 그러나 in 뒤에는 리스트, 튜플, 문자열 등이 들어갈 수 있기 때문에 len(numbers)과 인덱스를 통해 데이터를 찾지 않아도 된다. in 뒤에 리스트명 또는 리스트를 넣으면, ..
이것이 취업을 위한 코딩 테스트다 with 파이썬 - 나동빈 저 Chapter 1 - 3. 복잡도 정리 내용 복잡도는 알고리즘의 성능을 나타내는 척도로, 시간 복잡도와 공간 복잡도로 나눌 수 있다. 시간 복잡도 : 특정 크기의 입력에 대하여 알고리즘이 얼마나 오래 걸리는지를 의미. 알고리즘을 위해 필요한 연산의 횟수. 공간 복잡도 : 특정 크기의 입력에 대하여 알고리즘이 얼마나 많은 메모리를 차지하는지를 의미. 알고리즘을 위해 필요한 메모리의 양. 동일 기능을 수행하는 알고리즘이 있다면 일반적으로 복잡도가 낮을 수록 좋은 알고리즘이다. 코딩 테스트에서 문제를 풀 때, 가독성을 해치지 않는 선에서 최대한 복잡도가 낮게 프로그램을 작성해야 한다. 시간 복잡도 알고리즘 문제를 풀 때 단순히 '복잡도'라고 하면..
문제 설명 정수 배열 numbers가 매개변수로 주어집니다. numbers의 각 원소에 두배한 원소를 가진 배열을 return하도록 solution 함수를 완성해주세요. 제한사항 -10,000 ≤ numbers의 원소 ≤ 10,000 1 ≤ numbers의 길이 ≤ 1,000 입출력 예 numbers result [1, 2, 3, 4, 5] [2, 4, 6, 8, 10] [1, 2, 100, -99, 1, 2, 3] [2, 4, 200, -198, 2, 4, 6] 내 코드 - for 문 이용 function solution(numbers) { let answer = [];// 배열 선언 for(let i = 0; i map() 사용! .map() map() 메서드는 배열 내의 모든 요소 각각에 대하여 주..
3, 6, 9 게임 1부터 30까지 3, 6, 9게임을 하는 프로그램을 작성해 봅시다. 3, 6, 9게임의 규칙은 다음과 같습니다. 1부터 차례대로 말한다. 숫자 3, 6, 9가 들어가는 수의 경우에는 짝!을 출력한다. 예시) 6, 19, 23, 35 지시사항 위 3, 6, 9게임의 규칙에 맞게 1부터 30까지 출력되는 결과를 배열에 담아 solution 함수 안에서 return 해주세요. 내 오답 function solution() { const num = []; for (let i = 1; i 따라서 (i % 10) !== 0 조건문도 함께 작성해주어야 한다. 1 ~ 9 사이 모든 수가 "짝!" 으로 출력되는 이유? Math.floor(i / 10) % 3 === 0 는 Math.floor(i / 1..