일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
- Kaggle
- PYTHON
- ChatGPT
- 파이썬
- programmers
- SW Expert Academy
- ubuntu
- hackerrank
- Git
- 자연어처리
- 데이콘
- dacon
- 금융문자분석경진대회
- AI 경진대회
- Docker
- 편스토랑 우승상품
- gs25
- 맥북
- leetcode
- github
- Real or Not? NLP with Disaster Tweets
- 캐치카페
- 코로나19
- 편스토랑
- 프로그래머스
- 우분투
- 백준
- 프로그래머스 파이썬
- 더현대서울 맛집
- Baekjoon
- Today
- Total
목록
반응형
2020/06 (37)
솜씨좋은장씨
Count the number of prime numbers less than a non-negative number, n. Example: Input: 10 Output: 4 Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7. Solution class Solution: def getPrimaryNum_Eratos(N): nums = [True] * (N + 1) for i in range(2, len(nums) // 2 + 1): if nums[i] == True: for j in range(i+i, N, i): nums[j] = False return [i for i in range(2, N) if nums[i] == ..
Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator. Return the quotient after dividing dividend by divisor. The integer division should truncate toward zero, which means losing its fractional part. For example, truncate(8.345) = 8 and truncate(-2.7335) = -2. Example 1: Input: dividend = 10, divisor = 3 Output: 3 Explanation: 10/3 ..
Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ] Solution from itertools import permutations class Solution: def permute(self, nums: List[int]) -> List[List[int]]: permu = list(permutations(nums, len(nums))) return permu SOMJANG/CODINGTEST_PRACTICE 1일 1문제 since 2020.02.07. Contribut..
Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively. Note: You are not suppose to use the library's sort function for this problem. Example: Input: [2,0,2,1,1,0] Output: [0,0,..
Implement pow(x, n), which calculates x raised to the power n (x^n). Example 1: Input: 2.00000, 10 Output: 1024.00000 Example 2: Input: 2.10000, 3 Output: 9.26100 Example 3: Input: 2.00000, -2 Output: 0.25000 Explanation: 2-2 = 1/22 = 1/4 = 0.25 Note: -100.0 float: my_pow_num = pow(x, n) if my_pow_num > (pow(2, 31) - 1): my_pow_num = pow(2, 31) -1 elif my_pow_num < (pow(2, 31)) * (-1): my_pow_nu..
1일 1문제 116일차! 오늘의 문제는 백준의 파도반 수열 입니다. 9461번: 파도반 수열 문제 오른쪽 그림과 같이 삼각형이 나선 모양으로 놓여져 있다. 첫 삼각형은 정삼각형으로 변의 길이는 1이다. 그 다음에는 다음과 같은 과정으로 정삼각형을 계속 추가한다. 나선에서 가장 긴 � www.acmicpc.net Solution loopNum = int(input()) nums = [] answer = [] for i in range(loopNum): inputNum = int(input()) nums.append(inputNum) for iN in nums: if iN
1일 1문제 115일차! 115일차의 문제는 제곱수의 합입니다. 1699번: 제곱수의 합 어떤 자연수 N은 그보다 작거나 같은 제곱수들의 합으로 나타낼 수 있다. 예를 들어 11=32+12+12(3개 항)이다. 이런 표현방법은 여러 가지가 될 수 있는데, 11의 경우 11=22+22+12+12+12(5개 항)도 가능하다 www.acmicpc.net Solution inputNum = int(input()) nc = [0] * (inputNum+1) for i in range(1, inputNum+1): nc[i] = i for j in range(1, i): if (j * j) > i: break nc[i] = min(nc[i], nc[i - j * j] + 1) print(nc[inputNum]) SO..