Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 경로생성
- OSQP
- DynamicProgramming
- Frenet Coordinate
- Recursion
- CUDA
- Dubins Path
- PathPlanning
- 수치최적화
- GNN
- GIT
- CPP
- C
- 공유라이브러리
- Motion Planning
- Hybrid A star
- solver
- 동적라이브러리
- Leetcode
- 강화학습
- MDP
- autonomous vehicle
- self driving car
- C++
- path planning
- 선형대수
- 소프티어
- 정적라이브러리
- Graph Neural Network
- 백준
Archives
- Today
- Total
Swimmer
[LeetCode] 1720 Decode XORred Array 본문
Solution
- Use principle : A ^ B = C -> A ^ C = B
class Solution {
public:
vector<int> decode(vector<int>& encoded, int first) {
vector<int> res;
res.push_back(first);
for (int i = 0; i != encoded.size(); ++i)
{
res.push_back(res.back() ^ encoded[i]);
}
return res;
}
};
'코딩 문제' 카테고리의 다른 글
LeetCode 1768 Merge String Alternately (0) | 2023.07.17 |
---|---|
[LeetCode] 771, Jewels and Stones (0) | 2023.02.14 |
[LeetCode] 728. Self Dividing Numbers, C++ (0) | 2023.01.26 |
[LeetCode] 2032. Two Out of Three, C++ (0) | 2023.01.25 |
[Leet Code] 231. Power of Two, C++ (0) | 2023.01.17 |
Comments