일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Dubins Path
- Frenet Coordinate
- OSQP
- self driving car
- GIT
- 동적라이브러리
- DynamicProgramming
- 선형대수
- CPP
- Leetcode
- C++
- path planning
- 수치최적화
- Graph Neural Network
- C
- MDP
- 공유라이브러리
- Hybrid A star
- solver
- Recursion
- autonomous vehicle
- 소프티어
- 강화학습
- PathPlanning
- GNN
- 정적라이브러리
- Motion Planning
- 백준
- 경로생성
- CUDA
- Today
- Total
목록Leetcode (18)
Swimmer
Level은 Medium으로 책정되었지만 좀 더 쉬운 난이도의 문제이다. 데이터 구조 Queue를 사용하고 Dynamic Programming 개념을 차용하면 풀 수 있다. class Solution { public: int uniquePaths(int m, int n) { int arr[100][100] = { 0 }; int AlreadyQueue[100][100] = { 0 }; queue grid; pair SearchGrid; grid.push(make_pair(0, 0)); arr[0][0] = 1; while (!grid.empty()) { SearchGrid = grid.front(); grid.pop(); // Go Down if (SearchGrid.first < (m - 1)){ ar..
Skill Use hash table to decrease time complexity to under log(n^2) Others Use string struct member Use ASCII Number of english letter int gstHashTable[60] = { 0 }; class Solution { public: int numJewelsInStones(string jewels, string stones) { memset(&gstHashTable, 0, sizeof(int) * 60); int RetVal = 0; for (int i = 0; i != stones.size(); ++i) { gstHashTable[stones[i] - 65]++; } for (int i = 0; i ..
Solution Use principle : A ^ B = C -> A ^ C = B class Solution { public: vector decode(vector& encoded, int first) { vector res; res.push_back(first); for (int i = 0; i != encoded.size(); ++i) { res.push_back(res.back() ^ encoded[i]); } return res; } };
Solution - Calculate digit, Check integer is divable by all digits class Solution { public: bool IdSelfDividingNumber(int n) { int k = 10; int a = n; for (int i = 1; i != 5; ++i) { int digit = a % k; if (digit == 0) { return false; } else if (n % digit != 0) { return false; } else { // Do Nothing } a = a / k; if (a == 0) { return true; } } return true; } vector selfDividingNumbers(int left, int ..