일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 공유라이브러리
- DynamicProgramming
- 수치최적화
- CPP
- Graph Neural Network
- C
- self driving car
- path planning
- 소프티어
- Frenet Coordinate
- Hybrid A star
- OSQP
- GNN
- C++
- 강화학습
- Dubins Path
- PathPlanning
- Motion Planning
- 백준
- MDP
- 경로생성
- Leetcode
- 정적라이브러리
- 동적라이브러리
- CUDA
- solver
- Recursion
- autonomous vehicle
- GIT
- 선형대수
- Today
- Total
목록전체 글 (128)
Swimmer
Solution Get Total Sum of alice and bob candis number Calculate how many candies should be exchanged, to get equal num each other. But this method Runtime too much, only Beats 7.14% in Leet Code. Topics (presented in LeetCode) Hash Table Binary Search Sorting int* fairCandySwap( int* aliceSizes, int aliceSizesSize, int* bobSizes, int bobSizesSize, int* returnSize) { int i = 0; int aliceCandyNum ..
Solution - Use Hash Map - Compare Counting Number of each Character (except 0 occurence character) #define NumOfLowerCaseEnglishLetter 26 #define ASCII_INIT_NUM_IDX 97 bool areOccurrencesEqual(char* s) { long int NumOfChar = 0; int RefNum = 0; int arr[NumOfLowerCaseEnglishLetter] = { 0 }; // consists of lowercase English letters bool RetVal = true; while (s[NumOfChar] != '\0') { ++arr[s[NumOfCha..
Solution 1 using Hash Map Intuition Declare Hash Map represents charactoer 'a' to 'z' (size 26) Increase Hash Map Index which is in Magazine Note Decrease Hash Map Index which is in ransom Note If one of value in Hash Map under 0, Return false (it means character of Magazine Note doesn't represent ransom Note) When you use index, use should consider ASCII number of 'a' at inital index (97) bool ..
Idea When we need to find median value, index -> we can use this algorithms move two step forward agent, move onstep forward agent per scenario. /** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNode *next; * }; */ struct ListNode* middleNode(struct ListNode* head){ struct ListNode* first = head; struct ListNode* second = head; while(first && first->next) { sec..