반응형
https://leetcode.com/problems/valid-boomerang/description/
직선의 기울기를 이용한 문제였습니다.
📕 풀이방법
📔 풀이과정
📕 Code
📔 C++
class Solution {
public:
bool isBoomerang(vector<vector<int>>& points) {
return (points[0][1] - points[1][1]) * (points[1][0] - points[2][0]) != (points[0][0] - points[1][0]) * (points[1][1] - points[2][1]);
}
};
*더 나은 내용을 위한 지적, 조언은 언제나 환영합니다.
'Algorithm > Math' 카테고리의 다른 글
(C++) - LeetCode (easy) 1518. Water Bottles (0) | 2024.04.17 |
---|---|
(C++) - LeetCode (easy) 1207. Unique Number of Occurrences (0) | 2023.12.07 |
(C++) - LeetCode (easy) 1025. Divisor Game (0) | 2023.10.11 |
(C++, Rust) - LeetCode (easy) 914. X of a Kind in a Deck of Cards (0) | 2023.08.30 |
(C++) - LeetCode (easy) 367. Valid Perfect Square (0) | 2023.02.23 |