일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- C++
- Leetcode
- PathPlanning
- MDP
- path planning
- Graph Neural Network
- 강화학습
- 수치최적화
- 백준
- Hybrid A star
- Recursion
- GIT
- autonomous vehicle
- Dubins Path
- 소프티어
- CUDA
- Frenet Coordinate
- 공유라이브러리
- solver
- Motion Planning
- C
- 경로생성
- CPP
- 선형대수
- DynamicProgramming
- 정적라이브러리
- OSQP
- self driving car
- GNN
- 동적라이브러리
- Today
- Total
목록Leetcode (18)
Swimmer
Solution - Use Three array hash maps - Check if element is in at least two array by sum of three array value is over 1 Time Complexity : O(n) Space Complexity : O(n) class Solution { public: int arrHashMap1[100] = { 0 }; int arrHashMap2[100] = { 0 }; int arrHashMap3[100] = { 0 }; vector twoOutOfThree(vector& nums1, vector& nums2, vector& nums3) { vector res; memset(arrHashMap1, 0, sizeof(int) * ..
Solution - Use Bitwise operator class Solution { public: bool isPowerOfTwo(int n) { if (n < 0) { return false; } else { return n && !(n & n - 1); } } };
Solution use recursive structure Tag Full binary tree class Solution { public: bool evaluateTree(TreeNode* root) { bool retval = true; if (root->left != nullptr && root->left != nullptr) // full binary tree { if (root->val == 2) // OR { retval = evaluateTree(root->left) || evaluateTree(root->right);; } else // operta = 3, AND { retval = evaluateTree(root->left) && evaluateTree(root->right);; } }..
Solution Brute Force Time Complexity : O(N^2) Space Omplexity : O(1) class Solution { public: vector twoSum(vector& nums, int target) { vector RetVal; for (int i = 0; i != nums.size(); ++i) { for (int j = i + 1; j != nums.size(); ++j) { if ((nums[i] + nums[j]) == target) { RetVal.push_back(i); RetVal.push_back(j); return RetVal; } } } RetVal.push_back(-1); RetVal.push_back(-1); return RetVal; } };