Skip to content

Instantly share code, notes, and snippets.

View gegagome's full-sized avatar

German Garces gegagome

  • Santa Barbara, CA
View GitHub Profile
#import "Hamming.h"
@implementation Hamming
+ (NSUInteger) compute:(NSString *)firstString against:(NSString *)secondString {
int hammingDistance = 0;
if ([firstString length] <= [secondString length]) {
hammingDistance = (int)[self loopForStringBeginningWithShort:firstString withLong:secondString];
} else {
hammingDistance = (int)[self loopForStringBeginningWithShort:secondString withLong:firstString];
import UIKit
class Bob {
class func hey(prompt: String) -> String {
let shouting = "Woah, chill out!"
let question = "Sure."
let touchy = "Fine, be that way."
let apathy = "Whatever."
if loopForMatch(type: NSCharacterSet.uppercaseLetterCharacterSet(), stringToEvaluate: prompt) {
return shouting
class Bob
{
func hey(prompt: String) -> String {
let shouting = "Woah, chill out!"
let question = "Sure"
let touchy = "Fine. Be that way!"
let apathy = "Whatever."
if (isLowerCase(prompt: prompt)) {
return shouting