Skip to content

Instantly share code, notes, and snippets.

Gugulethu mhlangagc

  • Johannesburg
Block or report user

Report or block mhlangagc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View strings.swift
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"
@mhlangagc
mhlangagc / quicksort.swift
Last active Apr 18, 2016
Implementation of a quick Sort algorithm in swift
View quicksort.swift
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)
}
You can’t perform that action at this time.