본문 바로가기

분류 전체보기134

Python 프로젝트 Heroku deploy 시 Determining which buildpack to use for this appremote: ! No default language could be detected for this app에 python + django 프로젝트를 Heroku에 deploy하려는 데 계속 No default language could be detected for this app 에러가 났다...! 이 때의 해결 방법은 1. 루트 폴더에 requirements.txt가 있는 지 확인. 없으면 $ pip freeze > requirements.txt 로 생성. 2. 루트 폴더에 runtime.txt가 있는 지 확인. 없으면 만들고, 안에는 python-3.8.10 과 같이 나의 python 버전을 써준다. 나의 python 버전이 궁금하면 $ ##_env/Scripts/activate (윈도우 기준, 가상 환경 실행) >>> python --version 하면 확인할 수 있다. 하지만!!! 나의 경우 몇 번을 확.. 2021. 6. 7.
[코딩 테스트] 리트코드207 -Course Schedule (Medium) in Python There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course bi first if you want to take course ai. For example, the pair [0, 1], indicates that to take course 0 you have to first take course 1. Return true if you can finish all courses. Otherwise, return fal.. 2021. 6. 2.
[코딩 테스트] 리트코드139 -Word Break (Medium) in Python Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words. Note that the same word in the dictionary may be reused multiple times in the segmentation 문자열 s와 문자열들의 집합 wordDict가 주어졌을 때, wordDict안의 단어로 s를 만들 수 있는 지 확인! 예시: Input: s = "leetcode", wordDict = ["leet","code"] Output: true Explanation: Return .. 2021. 6. 1.
[코딩 테스트] 리트코드70 - Climbing Stairs (Easy) in Python You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? n 개의 계단을 올라야 목적지에 다다를 수 있다. 한 번에 1개, 혹은 2개 계단씩 오를 수 있다면, 얼마나 다양한 방법으로 목적지에 갈 수 있을까? 예시 Input: n = 2 Output: 2 Explanation: There are two ways to climb to the top. 1. 1 step + 1 step 2. 2 steps Constraints 1 >>>>>> 파이썬 1초 평균 연산 1억 따라서 Me.. 2021. 6. 1.