일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 109. Convert Sorted List to Binary Search Tree
- t1
- 315. Count of Smaller Numbers After Self
- Decorator
- Regular Expression
- attribute
- shiba
- 밴픽
- Class
- LeetCode
- 파이썬
- 30. Substring with Concatenation of All Words
- 운영체제
- Substring with Concatenation of All Words
- 프로그래머스
- Protocol
- concurrency
- 컴퓨터의 구조
- 시바견
- Convert Sorted List to Binary Search Tree
- iterator
- 43. Multiply Strings
- data science
- kaggle
- 715. Range Module
- Generator
- Python Code
- Python
- Python Implementation
- DWG
- Today
- Total
목록Computer Science (367)
Scribbling
LeetCode 347. Top K Frequent Elements https://leetcode.com/problems/top-k-frequent-elements/ Top K Frequent Elements - LeetCode Can you solve this real interview question? Top K Frequent Elements - Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order. Example 1: Input: nums = [1,1,1,2,2,3], k = 2 Output: [1,2] leetcode.com stru..
class Solution { public: vector groupAnagrams(vector& strs) { unordered_map map; for (string str : strs) { string sorted_str = str; sort(sorted_str.begin(), sorted_str.end()); map[sorted_str].push_back(str); } vector ret; for (auto e : map) { ret.push_back(e.second); } return ret; } };
https://leetcode.com/problems/valid-anagram/ class Solution { public: bool isAnagram(string s, string t) { if (s.size() != t.size()) { return false; } unordered_map map1; unordered_map map2; for (auto c : s) { map1[c]++; } for (auto c : t) { map2[c]++; } for (auto x : map1) { if (x.second != map2[x.first]) { return false; } } return true; } };
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..