일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 파이썬
- 715. Range Module
- attribute
- 운영체제
- Regular Expression
- Python Implementation
- Substring with Concatenation of All Words
- 109. Convert Sorted List to Binary Search Tree
- 43. Multiply Strings
- Python Code
- Convert Sorted List to Binary Search Tree
- 밴픽
- 315. Count of Smaller Numbers After Self
- LeetCode
- 프로그래머스
- concurrency
- Class
- 30. Substring with Concatenation of All Words
- 시바견
- Decorator
- iterator
- t1
- kaggle
- data science
- Python
- shiba
- DWG
- Protocol
- 컴퓨터의 구조
- Generator
- Today
- Total
목록분류 전체보기 (407)
Scribbling
https://leetcode.com/problems/contains-duplicate/ class Solution { public: bool containsDuplicate(vector& nums) { return nums.size() > unordered_set(nums.begin(), nums.end()).size(); } };
How does one can find the number of pairs in an array that satisfies the below condition? : lower
In a network system, a rate limiter controls the traffic rate that a client or a service sends. Most APIS have rate limiters in any form. Rate limiter 1) prevents DOS (Denial of Service); 2) reduces costs; and 3) prevents server overloads. Where should the rate limiter be placed? - It can be placed on the server side. - We may put a separate middleware layer for the rate limiter. In the cloud mi..
CS interview is a process where two people discuss a vague problem where there's no set solution. It's more of a simulation of the process of trying to look for potential solutions to the problem. 1. Ask the right questions Do not make an answer before clarifying things. One of the most important virtues that an engineer should have is asking the right questions. Example questions: - What featur..
1. Simple Web Application 2. Relational vs Non-relational DB Non-relational DB - very low latency - can handle unstructured data 3. Load Balancer Relying on a single server can be problematic; it may not handle heavy traffic. A load balancer can operate a web application with many servers. 4. Database Multiplexing Database multiplexing not only enhances the overall system reliability but also im..
Q: Given arbitrary ranges, merge all the ranges that overlap with each other. Return the resultant ranges. 1. Sort all the ranges by their start and end. 2. Now that we know that range's start increases we have to take care of the ends --> We have to take care of the two cases below. 3. Code ranges = [] ranges.append(schedules[0]) for s, e in schedules: if s '[Interval]': schedules = [] for i in..
Q: Find the number of unique strings of which the length is L, given that the maximum number of consecutive vowels allowed is K. * There are 21 types of consonants and 5 types of vowels. For example, L=4, K=1: then allowed patterns are - CCCC CCCV, CCVC, CVCC, VCCC, VCVC, VCCV, CVCV This question can be easily handled with DFS. However, the approach would not be optimal as it involves unnecessar..
A dynamic programming approach: Let dp[i, j] be the total number of cases of target[i] corresponding to jth position dp[i, j] = dp[i][j-1] + dp[i-1][j-1] * counter[j, target[i]] 1) Bottom-up import string from functools import lru_cache class Solution: def numWays(self, words: List[str], target: str) -> int: N = len(words[0]) freqs = [{c: 0 for c in string.ascii_lowercase} for _ in range(N)] for..
class Solution { public int eraseOverlapIntervals(int[][] intervals) { if (intervals.length == 0) return 0; Arrays.sort(intervals, new Comparator(){ @Override public int compare(int[] o1, int[] o2) { return o1[1]-o2[1]; } }); int cnt = 1; int end = intervals[0][1]; for (int i=1; i= end) { cnt += 1; end = intervals[i][1]; } } return intervals.length - cnt; } }
class TrieNode { public boolean isWord = false; public TrieNode[] children = new TrieNode[26]; } class Trie { public TrieNode root; public Trie() { root = new TrieNode(); } public void insert(String word) { TrieNode cur = root; for (int i=0; i