본문 바로가기

전체 글

[LeetCode] 26. Remove Duplicates from Sorted Array 기록 https://leetcode.com/problems/remove-duplicates-from-sorted-array/description/ Remove Duplicates from Sorted Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 오름차순으로 정렬된 중복되는 숫자가 존재하는 array에서 중복 숫자를 제거하는 문제 제거 하는 문제는 일반적으로 뒤에서부터 루프를 돌아야 index 관리가 편하다. class Solution: def remo.. 더보기
[Python3] "[Errno 2] No such file or directory: 'gs'" 해결방법 PIL(pillow) 패키지로 ps 확장자 파일을 여는 도중 에러가 발생 [Errno 2] No such file or directory: 'gs' 찾아보니 gs라는 파일은 ghostscript로 어도비나 PDF 계열의 파일을 호환하는 소프트웨어(WIKI) 바로 패키지 매니저로 처리! yum install ghostscript 설치후 gs 명령어로 설치 확인 [ec2-user@ip-172-31-40-202 work]$ gs GPL Ghostscript 9.25 (2018-09-13) Copyright (C) 2018 Artifex Software, Inc. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for .. 더보기
[coursera]Introduction to Git and GitHub 강의 수강 기록 1주차 솔직히 Git이나 VCS에 대한 기본 개념은 있기 때문에 1주차는 거의 놀면서 들었다.(개꿀) 주로 정의에 대해 나오는데 평소에 들어본적 없는 단어 정리 working tree: 우리가 작업하는 일반 폴더 index: working tree에서 저장소로 올리기 전에 기록하는 공간 staging: index에 파일 상태를 기록하는 것, commit 전에 staging area에 변경사항이 있어야함 git directory: 마치 데이터베이스처럼 동작하며 Git의 모든 변경사항을 트래킹 한다 과제도 그냥 따라하기만 하면 끝! 2주차 내가 이미 아는 내용은 패스하고 몰랐던 내용 중 유용해 보이는 것만 정리 commit -a: tracking하고 있는 파일에 변화가 있을 경우 모두 add하고 commit.. 더보기
[LeetCode] 21. Merge Two Sorted Lists 기록 https://leetcode.com/problems/merge-two-sorted-lists/description/ Merge Two Sorted Lists - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 두개의 linked list를 sorting하면서 합치는 문제 일단 적나라한 실력 테스트를 위해 그냥 풀었다. # Definition for singly-linked list. class ListNode: def __init__(self, val=0, ne.. 더보기
[LeetCode] 151. Reverse Words in a String 기록 https://leetcode.com/problems/reverse-words-in-a-string/ Reverse Words in a String - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 단어들을 뒤집는 문제로 스페이스 처리가 약간 귀찮은 문제이다. 일단 기능적으로 돌아가기만 하도록 빨리 짜봄 class Solution: def reverseWords(self, s: str) -> str: words = [] word = '' for c in s: i.. 더보기
[LeetCode] 20. Valid Parentheses 기록 https://leetcode.com/problems/valid-parentheses/ Valid Parentheses - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 괄호가 있는 input이 valid한지 판별하는 문제이다. 앞에서 열었던 괄호들을 FILO로 처리해야 하므로 stack을 통해서 구현하면 되겠다 생각 파이썬에서는 스택이 필요하면 리스트를 사용한다. push는 appned()로 pop은 pop()으로 사용 대응하는 무엇인가를 찾는일이므로 참조테이.. 더보기
Airflow 주요 개념 정리 사용을 위한 기본 개념 DAG: AirFlow에서 실행할 작업들은 순서에 맞게 구성한 워크플로우를 의미, Directed Acyclic Graph(유향 순환 그래프)의 약자로 DAG를 구성하는 각 작업들은 TASK라고 한다. TASK: DAG를 구성하는 각 작업들, TASK는 Operator, Sensor, Hook 등을 사용할 수 있다. Operator: 지정한 작업을 수행하는 실행 도구 ( ex. python operator, bash operator, postgres operator) Sensor: 어떤 결과를 만족하는지 주기적으로 체크할 때 사용 ( ex.데이터 파이프라인에서 이전 작업의 결과물이 잘 생성되었는지 확인) Hook: DB나 서비스 같은 외부 시스템과 통신하기 위한 인터페이스를 제공하.. 더보기
[centos7] OpenSSL1.1.1 설치 centos7에서 python 3.10 버전을 컴파일 할 때 openssl 1.1 이상의 라이브러리가 필요하다. 하지만 기본적으로 깔려있는 버전은 openssl 1.0 버전이다. 다음은 centos7에서 openSSL 1.1.1을 설치하고 pyenv에서 python3.10.x 버전 설치하는 방법을 정리했다. 에러메시지 Installing Python-3.10.7... ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib? Please consult to the Wiki page to fix the problem. https://github.com/pyenv/pyenv/wiki/Common-build-problems BUILD .. 더보기