| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- File
- html
- list
- SQL
- css
- PostgreSQL
- insert
- regex
- Oracle
- lambda
- spring
- dict
- port
- MAP
- Linux
- jQuery
- db
- Windows
- Git
- JSON
- jsp
- JS
- Session
- table
- regExp
- STS
- key
- Java
- Python
- JavaScript
- Today
- Total
목록분류 전체보기 (100)
step1
*len 99999 list 로 테스트시 소요 시간(microseconds) 1. using collections.Counter() import collections def getFreqByCollections(org_list): return collections.Counter(org_list) ⇒ 2735 microseconds 2. make it as a set → count def getFreqByCount(org_list): return {x:org_list.count(x) for x in set(org_list)} ⇒ 4987 microseconds 3. using itertools.groupby() from itertools import groupby def getFreqByGroupby(or..
문제 array 가 주어졌을 때, 해당 array 안의 연속된 subarray 중 원소의 합이 가장 큰 것 구하기 최대 부분합 구하기! 힌트! 포인트는 "연속된" 이라는 것. 설명 → 이전 부분합이 현재 인덱스 까지의 최대 부분합에 영향을 미친다. if (현재_인덱스_값) > (이전단계_부분합) + (현재_인덱스_값): subarray = [현재_인덱스_값] #이전 subarray 버리고! 현재 인덱스 값부터 새로운 subarray 생성해서 재시작 else: subarray = (이전단계_subarray).append(현재_인덱스_값) 부분합을 구해서 현재 단계에서 이전 부분합을 이용할건지(이전 subarray에 현재 값을 추가할건지), 이전 부분합을 사용하지 않고 현재 단계부터 새로운 subarray ..
생일로 나이 구하기 rough select extract(year from age(to_timestamp('20000102', 'yyyymmdd'))) as age -- 23 specific select age(to_timestamp('20000102', 'yyyymmdd')); -- 23 years 6 mons 19 days -- today : 2023-07-21
이전 / 이후 시간 구하기 -- NOW select current_timestamp; -- TWO HOURS BEFORE select current_timestamp + '-2 hours'; -- TWO DAYS BEFORE select current_timestamp + '-2 days'; -- TWO WEEKS BEFORE select current_timestamp + '-2 weeks'; -- TWO MONTHS AFTER select current_timestamp + '2 months'; -- TWO YEARS AFTER select current_timestamp + '2 years';
Two Pointers 를 사용해 Linked List 내에 cycle이 있는지 판단 Ponter 1, the fast one : moves twice as fast as the other one Ponter 2, the slow one Cycle이 있다면, 두 개의 포인터가 어느 지점에서 만날 것! Cycle이 없다면, 두 개의 포인터가 만나지 않고, 더 빠른 포인터가 연결리스트의 끝에 도달할 것