일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 프로그래머스
- Class
- Convert Sorted List to Binary Search Tree
- Protocol
- DWG
- 315. Count of Smaller Numbers After Self
- 컴퓨터의 구조
- LeetCode
- 715. Range Module
- 시바견
- Decorator
- concurrency
- kaggle
- 109. Convert Sorted List to Binary Search Tree
- 운영체제
- attribute
- t1
- shiba
- 밴픽
- 43. Multiply Strings
- Substring with Concatenation of All Words
- Python Implementation
- Generator
- Python Code
- 30. Substring with Concatenation of All Words
- 파이썬
- data science
- Regular Expression
- iterator
- Python
Archives
- Today
- Total
목록Computer Science/C++ (31)
Scribbling
[C++ Reminder] LeetCode 1. Two Sum
#include #include using namespace std; class Solution { public: vector twoSum(vector& nums, int target) { vector res; unordered_map hash; for (int i = 0; i < nums.size(); i++) { int num = target - nums[i]; // found if (hash.find(num) != hash.end()) { res.push_back(hash[num]); res.push_back(i); return res; } hash[nums[i]] = i; } return res; } }; int main() { vector vec{ 2, 7, 11, 15 }; Solution()..
Computer Science/C++
2023. 1. 23. 06:57