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
- 소프티어
- CPP
- 동적라이브러리
- Recursion
- DynamicProgramming
- 백준
- 선형대수
- PathPlanning
- Graph Neural Network
- 공유라이브러리
- self driving car
- GNN
- 강화학습
- MDP
- solver
- 경로생성
- autonomous vehicle
- Leetcode
- CUDA
- C
- C++
- GIT
- 정적라이브러리
- Motion Planning
- Dubins Path
- 수치최적화
- Hybrid A star
- path planning
- OSQP
- Frenet Coordinate
Archives
- Today
- Total
Swimmer
[Leet Code] 231. Power of Two, C++ 본문
Solution
- Use Bitwise operator
class Solution {
public:
bool isPowerOfTwo(int n) {
if (n < 0)
{
return false;
}
else
{
return n && !(n & n - 1);
}
}
};
'코딩 문제' 카테고리의 다른 글
[LeetCode] 728. Self Dividing Numbers, C++ (0) | 2023.01.26 |
---|---|
[LeetCode] 2032. Two Out of Three, C++ (0) | 2023.01.25 |
[LeetCode] 2331. Evaluate Boolean Binary Tree, cpp (0) | 2023.01.10 |
[LeetCode] 1880. Check if Word Equals Summation of Two Words, C (0) | 2023.01.05 |
[LeetCode] 2406. Divide Intervals Into Minimum Number of Groups, C (0) | 2023.01.02 |
Comments