This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution { | |
func fib(_ N: Int) -> Int { | |
return self.recursiveWay(N) | |
} | |
func recursiveWay(_ N: Int) -> Int { | |
if N == 0 { return 0 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution { | |
func isPalindrome(_ x: Int) -> Bool { | |
return self.reverseWay(x) | |
} | |
// Recommanded | |
func reverseWay(_ x: Int) -> Bool { | |
OlderNewer