분류 전체보기 (438) 썸네일형 리스트형 [비트연산] 릿코드 Easy 190 'Reverse Bits' (Python) https://leetcode.com/problems/reverse-bits/ Reverse Bits - 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 n은 정수형으로 들어오기 때문에 binary로 바꿔줌. binary로 바꾸면 맨 앞에 0b가 붙으므로 제거해줌 2진수는 32bit의 길이를 유지해야하므로 zfill함수를 이용해 맨 앞에 0을 붙여줌 1을 가진 자리는 2의 지수만큼 곱해줌 class Solution: def reverseBits(self, n: i.. [에세이][독후감] "여행의 이유" - 김영하 여행의 이유 여행의 감각을 일깨우는 소설가 김영하의 매혹적인 이야기 『여행의 이유』. 꽤 오래전부터 여행에 대해 쓰고 싶었던 저자가 처음 여행을 떠났던 순간부터 최근의 여행까지 자신의 모든 여행의 경험을 담아 써내려간 아홉 개의 이야기를 담은 책이다. 지나온 삶에서 글쓰기와 여행을 가장 많이, 열심히 해온 저자는 여행이 자신에게 무엇이었는지, 무엇이었기에 그렇게 꾸준히 다녔던 것인지, 인간들은 왜 여행을 하는지, 스스로에게 질문을 던졌고, 여행의 이유를 찾아가며 그 답을 알아가고자 한다. 2005년, 집필을 위한 중국 체류 계획을 세우고 중국으로 떠났으나 입국을 거부당하고 추방당했던 일화로 시작해 사람들이 여행을 하는 목적에 대한 질문으로 이어지는 《추방과 멀미》, 일상과 가족, 인간관계에서 오는 상처와.. [비트연산] 릿코드 Easy 191 'Number of 1 Bits' (Python) https://leetcode.com/problems/number-of-1-bits/ Number of 1 Bits - 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 정수로 들어온 값을 2진수로 바꿔주고 1의 개수를 센다 class Solution: def hammingWeight(self, n: int) -> int: return str(bin(n)).count('1') [동적계획법] 릿코드 Medium 120 'Triangle' (Python) https://leetcode.com/problems/triangle/ Triangle - 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 삼각형의 꼭대기에서 바닥까지의 합을 구하는 것이므로, 아래 칸으로 이동할 때 윗 칸의 숫자를 더해준다. 삼각형의 왼쪽 변의 숫자는 항상 왼쪽 숫자를 더하고, 오른쪽 변의 숫자는 항상 오른쪽 숫자를 더한다. 삼각형의 가운데 숫자들은 자신의 위의 숫자 2개에서 작은 값을 더하면 된다. 숫자를 다 더한 바닥의 숫자들 중 최솟값을 반.. H2 DB 사용하기 1. https://www.h2database.com/html/main.html H2 Database Engine H2 Database Engine Welcome to H2, the Java SQL database. The main features of H2 are: Very fast, open source, JDBC API Embedded and server modes; in-memory databases Browser based Console application Small footprint: around 2.5 MB jar file size Supp www.h2database.com 2. 3. 압축 풀기 4. 5. 6. C:\Users\사용자에 test.mv.db 파일 생긴것을 확인 7. 파일로 접.. CentOS (putty)에 mariaDB 설치하기 1. putty 또는 CentOS에 접속 > mariadb 설치 > mariadb 시작 > mariadb 자동 실행 # yum install mariadb-server -y#설치 # systemctl status mariadb#상태확인 # systemctl start mariadb#중지되어있으므로 시작 # systemctl status mariadb#시작된 것을 확인 # systemctl enable mariadb#자동실행 설정 [BFS] 릿코드 Medium 695 'Max Area of Island' (Python) https://leetcode.com/problems/max-area-of-island/ Max Area of Island - 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 상하좌우로 1이 연결된 면적 구하기 최대 면적 구하기 class Solution: def maxAreaOfIsland(self, grid: List[List[int]]) -> int: tmp = 0 answer = 0 dx = [-1,0,1,0] dy = [0,-1,0,1] for x in .. [BFS] 릿코드 Easy 733 'Flood Fill' (Python) https://leetcode.com/problems/flood-fill/ Flood Fill - 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 주어진 image [sr][sc]에서 위, 아래, 왼쪽, 오른쪽에 있는 값이 처음 image [sr][sc]와 동일하면 newColor로 변경한다. 변경한 값의 위, 아래, 왼쪽, 오른쪽 값도 변경한다. (반복) class Solution: def floodFill(self, image: List[List[int]], .. 이전 1 ··· 37 38 39 40 41 42 43 ··· 55 다음