분류 전체보기
-
7. 숫자 문자열과 영단어Programmers 2023. 6. 14. 13:51
숫자 문자열과 영단어 네오와 프로도가 숫자놀이를 하고 있습니다. 네오가 프로도에게 숫자를 건넬 때 일부 자릿수를 영단어로 바꾼 카드를 건네주면 프로도는 원래 숫자를 찾는 게임입니다. 다음은 숫자의 일부 자릿수를 영단어로 바꾸는 예시입니다. 1478 → "one4seveneight" 234567 → "23four5six7" 10203 → "1zerotwozero3" 이렇게 숫자의 일부 자릿수가 영단어로 바뀌어졌거나, 혹은 바뀌지 않고 그대로인 문자열 s가 매개변수로 주어집니다. s가 의미하는 원래 숫자를 return 하도록 solution 함수를 완성해주세요. 참고로 각 숫자에 대응되는 영단어는 다음 표와 같습니다. def solution(s): numbers = list('0123456789') word..
-
6.예산Programmers 2023. 6. 14. 06:56
문제 설명 S사에서는 각 부서에 필요한 물품을 지원해 주기 위해 부서별로 물품을 구매하는데 필요한 금액을 조사했습니다. 그러나, 전체 예산이 정해져 있기 때문에 모든 부서의 물품을 구매해 줄 수는 없습니다. 그래서 최대한 많은 부서의 물품을 구매해 줄 수 있도록 하려고 합니다. 물품을 구매해 줄 때는 각 부서가 신청한 금액만큼을 모두 지원해 줘야 합니다. 예를 들어 1,000원을 신청한 부서에는 정확히 1,000원을 지원해야 하며, 1,000원보다 적은 금액을 지원해 줄 수는 없습니다. 부서별로 신청한 금액이 들어있는 배열 d와 예산 budget이 매개변수로 주어질 때, 최대 몇 개의 부서에 물품을 지원할 수 있는지 return 하도록 solution 함수를 완성해주세요. 제한사항 d는 부서별로 신청한 ..
-
5. 피보나치 수Programmers 2023. 6. 14. 06:38
문제 설명 피보나치 수는 F(0) = 0, F(1) = 1일 때, 1 이상의 n에 대하여 F(n) = F(n-1) + F(n-2) 가 적용되는 수 입니다. 예를들어 F(2) = F(0) + F(1) = 0 + 1 = 1 F(3) = F(1) + F(2) = 1 + 1 = 2 F(4) = F(2) + F(3) = 1 + 2 = 3 F(5) = F(3) + F(4) = 2 + 3 = 5 와 같이 이어집니다. 2 이상의 n이 입력되었을 때, n번째 피보나치 수를 1234567으로 나눈 나머지를 리턴하는 함수, solution을 완성해 주세요. (n은 2이상 100000 이하의 자연수) 해당 문제는 다이나믹 프로그래밍의 전형적인 유형이라고 생각해서 풀었었다. def solution(n): d = [0]*1000..
-
4. 최솟값 만들기Programmers 2023. 6. 13. 16:34
문제 설명 길이가 같은 배열 A, B 두개가 있습니다. 각 배열은 자연수로 이루어져 있습니다. 배열 A, B에서 각각 한 개의 숫자를 뽑아 두 수를 곱합니다. 이러한 과정을 배열의 길이만큼 반복하며, 두 수를 곱한 값을 누적하여 더합니다. 이때 최종적으로 누적된 값이 최소가 되도록 만드는 것이 목표입니다. (단, 각 배열에서 k번째 숫자를 뽑았다면 다음에 k번째 숫자는 다시 뽑을 수 없습니다.) 예를 들어 A = [1, 4, 2] , B = [5, 4, 4] 라면 A에서 첫번째 숫자인 1, B에서 첫번째 숫자인 5를 뽑아 곱하여 더합니다. (누적된 값 : 0 + 5(1x5) = 5) A에서 두번째 숫자인 4, B에서 세번째 숫자인 4를 뽑아 곱하여 더합니다. (누적된 값 : 5 + 16(4x4) = 21..
-
3. 숫자의 표현Programmers 2023. 6. 13. 16:26
문제 설명 Finn은 요즘 수학공부에 빠져 있습니다. 수학 공부를 하던 Finn은 자연수 n을 연속한 자연수들로 표현 하는 방법이 여러개라는 사실을 알게 되었습니다. 예를들어 15는 다음과 같이 4가지로 표현 할 수 있습니다. 1 + 2 + 3 + 4 + 5 = 15 4 + 5 + 6 = 15 7 + 8 = 15 15 = 15 자연수 n이 매개변수로 주어질 때, 연속된 자연수들로 n을 표현하는 방법의 수를 return하는 solution를 완성해주세요. 제한사항 n은 10,000 이하의 자연수 입니다. 제약식을 한 번 고려해보자. 연속된 자연수끼리의 합은 결국 초항이 a이고 등차가 1인 k개의 원소를 가진 등차수열의 합을 더하는 것과 같다. - a + (a+ 1) + (a + 2) + ... + (a +..
-
-
[Boaz] Data Pipeline 발제자료Data Engineer 2023. 6. 7. 12:40
현대 데이터 인프라의 현실 데이터가 매우 다양한 소스에서 수집된다는 것! 이 때문에 소스 시스템에서 스키마 및 비즈니스 로직 변경을 처리하는 일률적인 방법을 찾기 힘들다. 1. 추상화 도입 가능하면 소스 시스템과 수집 프로세스 사이에 추상화 계층을 도입하는 것이 좋음 소스 시스템의 소유자가 추상화 방법을 유지/인식 하는 것이 Best! 예시 상황 : Postgres 데이터베이스에서 직접 데이터를 수집하는 대신 데이터베이스 소유자와 협력하여 데이터베이스에서 데이터 추출을 위해 쿼리할 수 있는 REST API를 구축하는 것을 고려 API가 단순히 거쳐 지나가는 단계라고 할지라도 그것이 소스 시스템 소유자가 유지 관리하는 코드에 존재한다는 것은 시스템 소유자가 어떤 데이터가 추출되고 있는지 알고 있다는 것을 ..
-
[Netflix TechBlog] Data PipeLine_Asset ManagementData Engineer 2023. 6. 4. 14:35
배포판 관리 *출처 https://netflixtechblog.com/data-pipeline-asset-management-with-dataflow-86525b3e21ca https://netflixtechblog.com/ready-to-go-sample-data-pipelines-with-dataflow-17440a9e141d Data pipeline asset management with Dataflow by Sam Redai, Jai Balani, Olek Gorajek netflixtechblog.com - Asset : Any business logic code in a raw or compiled form to be executed as part of the user defined data ..