Swift Solution - Simple 1 Line Solution


  • 0
    Z

    Pretty self explanatory, simple one:

    class Solution {
        func mySqrt(_ x: Int) -> Int {
            return Int(Double(x).squareRoot())
        }
    }
    

Log in to reply
 

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