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
func twoStrings(stringA: String, stringB: String) -> String { | |
let firstSet = Set(stringA.lowercaseString.characters) | |
let secondSet = Set(stringB.lowercaseString.characters) | |
if firstSet.intersect(secondSet).count > 0 { | |
return "YES" | |
} else { | |
return "NO" |
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
import UIKit | |
//Random Interger Generator :: You could alternatively create your own array of Intergers. I prefer a a random way to my array length, minumum and maximum elements. | |
func randomIntergerInRange(low:Int, high:Int) -> Int { | |
let randomGeneratedNumber = low + Int(arc4random()) % (high - low); | |
return Int(randomGeneratedNumber) | |
} |