Java 1 Line Solution


  • 0
    E
    public class Solution {
        public boolean isPerfectSquare(int num) {
            return ((int)Math.pow(num,0.5))*((int)Math.pow(num,0.5))==num?true:false;
        }
    }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.