일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- data science
- Protocol
- 파이썬
- concurrency
- 30. Substring with Concatenation of All Words
- Generator
- Python Code
- Regular Expression
- 프로그래머스
- DWG
- iterator
- 43. Multiply Strings
- Python
- 운영체제
- Class
- 밴픽
- kaggle
- LeetCode
- 109. Convert Sorted List to Binary Search Tree
- 715. Range Module
- t1
- Convert Sorted List to Binary Search Tree
- Decorator
- attribute
- Python Implementation
- 컴퓨터의 구조
- 315. Count of Smaller Numbers After Self
- 시바견
- shiba
- Substring with Concatenation of All Words
- Today
- Total
목록전체 글 (407)
Scribbling
https://leetcode.com/problems/lru-cache/description/ #include #include #include using namespace std;class Node {public: int key; int val; Node() {} Node(int key=-1, int val=-1) : key(key), val(val) {} ~Node() {}};class LRUCache {public: list ll; map::iterator> dict; int capacity; int cnt; LRUCache(int capacity) : capacity(capacity), cnt(0) {} int get(int key) { ..
#include using namespace std;class Printable { friend ostream& operator
https://leetcode.com/problems/implement-trie-prefix-tree/description/ Trie.h#pragma once#include class TrieNode{private: char ch; bool isWord; TrieNode* children[26] {nullptr};public: TrieNode(char ch, bool isWord=false); TrieNode(const TrieNode& node); TrieNode(TrieNode&& node); TrieNode& operator=(const TrieNode& rhs); TrieNode& operator=(TrieNode&& rhs); char getCh() const; bool getIsWord() ..
https://www.hackerrank.com/challenges/attribute-parser/problem?isFullScreen=true Attribute Parser | HackerRankParse the values within various tags.www.hackerrank.com #include #include #include #include #include #include #include using namespace std;int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int n, q; cin >> n >> q; cin.ignore(); /..
https://www.hackerrank.com/challenges/abstract-classes-polymorphism/problem?isFullScreen=true Abstract Classes - Polymorphism | HackerRankGiven an abstract class Cache, write a class LRUCache which extends the class Cache and implement an LRU cache.www.hackerrank.com #include #include #include #include #include #include #include using namespace std;struct Node{ Node* next; Node* prev; int ..
https://www.hackerrank.com/challenges/virtual-functions/problem?isFullScreen=true Virtual Functions | HackerRankLearn how to use virtual functions and solve the given problem.www.hackerrank.com #include #include #include #include #include using namespace std;class Person {public: string name; int age; Person() {} virtual void getdata() {}; virtual void putdata() {}; virtual..
C++ Regular Expressions Libraryhttps://en.cppreference.com/w/cpp/regex Regular expressions library (since C++11) - cppreference.comRegular expressions library The regular expressions library provides a class that represents regular expressions, which are a kind of mini-language used to perform pattern matching within strings. Almost all operations with regexes can be characterized byen.cpprefere..
https://school.programmers.co.kr/learn/courses/30/lessons/150369 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr The key is to eliminate the farthest houses.To identify the farthest ones, we may use max heaps. 1. Pythonimport heapqdef solution(cap, n, deliveries, pickups): h1 = [] h2 = [] for i, d in enumerate(deliveries): ..
https://leetcode.com/problems/length-of-the-longest-valid-substring/description/ The main idea is to use Trie data structure. 1. Pythonclass Solution: def longestValidSubstring(self, word: str, forbidden: List[str]) -> int: ret = 0 trie = {} for f in forbidden: f = f[::-1] t = trie for c in f: if c not in t: ..
https://leetcode.com/problems/minimum-adjacent-swaps-to-make-a-valid-array/description/ 1. Pythonclass Solution: def minimumSwaps(self, nums: List[int]) -> int: if len(nums) 2. C++class Solution {public: int minimumSwaps(vector& nums) { if (nums.size() =0; i--) { if (nums[i] == maxVal) { maxIdx = i; break; } } if (minIdx == maxIdx) return 0; else if (minIdx