본문 바로가기

Problem Solving/리트코드(leetcode)

Valid Perfect Square

class Solution {
public:
    bool isPerfectSquare(int num) {
        return ceil(sqrt(num)) == floor(sqrt(num)) ? true : false;
    }
};

'Problem Solving > 리트코드(leetcode)' 카테고리의 다른 글

[LeetCode/C++] 844. Backspace String Compare  (0) 2022.01.20
Determine if String Halves Are Alike  (0) 2022.01.16
Sqrt(x)  (0) 2022.01.16
Self Dividing Numbers  (0) 2022.01.16
Power of Four  (0) 2022.01.16