일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- PYTHON
- Docker
- dacon
- 데이콘
- SW Expert Academy
- leetcode
- Real or Not? NLP with Disaster Tweets
- Kaggle
- Git
- hackerrank
- 파이썬
- ubuntu
- 코로나19
- 더현대서울 맛집
- gs25
- 백준
- Baekjoon
- 편스토랑 우승상품
- programmers
- AI 경진대회
- 프로그래머스
- 우분투
- 캐치카페
- 맥북
- github
- ChatGPT
- 금융문자분석경진대회
- 자연어처리
- 편스토랑
- 프로그래머스 파이썬
- Today
- Total
목록
반응형
전체 글 (1653)
솜씨좋은장씨
Given a non-empty array of integers, return the k most frequent elements. Example 1: Input: nums = [1,1,1,2,2,3], k = 2 Output: [1,2] Example 2: Input: nums = [1], k = 1 Output: [1] Note: You may assume k is always valid, 1 ≤ k ≤ number of unique elements. Your algorithm's time complexity must be better than O(n log n), where n is the array's size. It's guaranteed that the answer is unique, in o..
Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twice in this array. Could you do it without extra space and in O(n) runtime? Example: Input: [4,3,2,7,8,2,3,1] Output: [2,3] Solution from collections import Counter class Solution: def findDuplicates(self, nums: List[int]) -> List[int]: cnt_items = ..
Given an integer, return its base 7 string representation. Example 1: Input: 100 Output: "202" Example 2: Input: -7 Output: "-10" Note: The input will be in range of [-1e7, 1e7]. Solution class Solution: def convertToBase7(self, num: int) -> str: if num == 0: return str(num) sign = 1 if num < 0: sign = -1 num = abs(num) answer = '' while num: answer = str(num % 7) + answer num //= 7 return ('-' ..
$ bash
심리 성향 예측 AI 경진대회 출처 : DACON - Data Science Competition dacon.io 3일차 4일차에 시도해본 내용을 정리한 글입니다. 3일차에는 tensorflow를 활용하여 결과를 내보기로 했습니다. import numpy as np import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras.layers import Dense from tensorflow.keras.utils import to_categorical from tensorflow.keras import metrics from tensorflow.keras import optimizers from tensorflow...
Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn]. Return the array in the form [x1,y1,x2,y2,...,xn,yn]. Example 1: Input: nums = [2,5,1,3,4,7], n = 3 Output: [2,3,5,4,1,7] Explanation: Since x1=2, x2=5, x3=1, y1=3, y2=4, y3=7 then the answer is [2,3,5,4,1,7]. Example 2: Input: nums = [1,2,3,4,4,3,2,1], n = 4 Output: [1,4,2,3,3,2,4,1] Example 3: Input: nums =..
An array is monotonic if it is either monotone increasing or monotone decreasing. An array A is monotone increasing if for all i
Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. Example: Input: 38 Output: 2 Explanation: The process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only one digit, return it. Follow up: Could you do it without any loop/recursion in O(1) runtime? Solution class Solution: def addDigits(self, num: int) -> int: while True: if num // 10 < 1: return n..