분류 전체보기
-
약수의 합Programmers 2023. 3. 19. 16:03
문제 설명 정수 n을 입력받아 n의 약수를 모두 더한 값을 리턴하는 함수, solution을 완성해주세요. 제한 사항 n은 0 이상 3000이하인 정수입니다. 입출력 예 n return 12 28 5 6 입출력 예 설명 입출력 예 #112의 약수는 1, 2, 3, 4, 6, 12입니다. 이를 모두 더하면 28입니다. 입출력 예 #25의 약수는 1, 5입니다. 이를 모두 더하면 6입니다. 나의 풀이 def solution(n): answer = 0 for i in range(1, n+1): if n%i == 0: answer += i return answer 다른 사람의 풀이 def sumDivisor(num): # num / 2 의 수들만 검사하면 성능 약 2배 향상잼 return num + sum([i..
-
자릿수 더하기Programmers 2023. 3. 19. 16:02
문제 설명 자연수 N이 주어지면, N의 각 자릿수의 합을 구해서 return 하는 solution 함수를 만들어 주세요.예를들어 N = 123이면 1 + 2 + 3 = 6을 return 하면 됩니다. 제한사항 N의 범위 : 100,000,000 이하의 자연수 입출력 예 N answer 123 6 987 24 입출력 예 설명 입출력 예 #1문제의 예시와 같습니다. 입출력 예 #29 + 8 + 7 = 24이므로 24를 return 하면 됩니다. 나의 풀이 def solution(n): n = list(str(n)) return sum([int(i) for i in n]) 다른 사람의 풀이 def sum_digit(number): '''number의 각 자릿수를 더해서 return하세요''' if number..
-
[검색 엔진 프로젝트] 1. 구글의 검색엔진 알고리즘Search Engine 2023. 3. 19. 15:41
Googling이라는 단어를 만들 정도로 압도적인 검색량과 지식 확보에 도움이 되는 구글. 최근 MicroSoft 사의 ChatGPT 등장과 함께 질세라 Google도 구글의 Bard를 출시했다고 하는데, 이 모델은 구글 검색엔진이 추가된다고 발표해 세간의 이목을 끌고 있다. 오늘은 이 검색엔진 알고리즘을 알아보기로 한다. 구글 검색엔진은 1998년 PageRank 알고리즘으로부터 지속적인 연구개발로, 수백가지의 알고리즘과 1년에도 여러 번 세부검색 알고리즘이 바뀌고 있다. 구글에서 공식적으로 발표한 검색 알고리즘은 다음과 같다. "검색어가 몇 번 포함되어 있는가?" "검색어의 위치(EX. 제목, Snippet, 문장에서의 위치 등)" "2개 이상의 단어를 검색했을 떄 검색어와 같이 연결되어 나오는가?"..
-
OLTP와 OLAP, 그리고 Data WarehouseData Engineer 2023. 3. 16. 15:37
데이터 엔지니어 채용을 보았을 때, 몇몇 기업들은 OLAP와 OLTP에 대한 경험을 우대사항으로 표기했었다. 데이터베이스 관련 지식이 부족한 본인은 이번 기회에 이 용어가 궁금해 알아보기로 했다! OLTP, Online Transaction Processing - 온라인 트랜잭션 처리 먼저 트랜잭션 처리에 대한 의미를 살펴볼 필요가 있다. 트랜잭션(Transaction) 처리는 주기적으로 수행되는 일관 작업과 달리 클라이언트가 지연 시간이 낮은 읽기와 쓰기를 가능하게 하는 것을 의미한다. (네트워크에서 HTTP 프로토콜을 공부했을 때 GET이나 POST 방식으로 서버와 클라이언트가 정보를 주고받는 한번의 행위를 트랜잭션이라고 배웠는데, 동일한 개념으로 받아들여도 될 것 같다.) 현재 DB는 많은 여러 종..
-
데이터 처리기술_분산 데이터 저장 기술Data Engineer 2023. 3. 15. 14:10
분산 데이터 저장 기술 데이터베이스 구축시 데이터를 복수개의 데이터 저장소에 분산하여 부하를 분산할 수 있다. 몇 개의 데이터베이스가 가동불능인 경우에도 임계치 이상의 데이터베이스가 가동 가능한 경우 안전하게 데이터를 접근할 수 있도록 결함 감내 기능을 제공하며, 복수 개의 분산정보를 복수 개의 데이터 저장소에 분산함으로써 보안성을 높인 데이터베이스 시스템 기술. 분산 파일 시스템은 Master node와 Slave node, 두 개의 노드로 구성되어 있다. 마스터 노드는 실제 데이터를 저장하는 서버 및 저장되어 있는 데이터를 관리하는 역할을 하고, 슬레이브 노드는 실제 데이터를 저장하는 역할 및 사용자 요청에 따라 데이터를 전달해 주는 역할을 한다. 마스터 노드 - 분산 파일 시스템에서 사용하고 있는 ..