HN user

pandaexpress

25 karma
Posts2
Comments12
View on HN

Because I don't see it as torture. I find Objective-C to be a perfectly pleasant tool, and it allows me to do things that would be A) implausible or B) impossible were I to make webapps (or PhoneGap apps) instead.

Matasano's site mentions office culture. Are remote employees impossible to work out? I'd LOVE to get into this sort of thing, but I'm not a US citizen and I don't qualify for any visas.

If I get in touch, would you point me towards some resources even if it won't lead to employment?

The solution (in Objective-C)

- (NSArray)pascal:(int)n { if (n == 1) return @[@(1)];

NSArray array = [self pascal:n-1]; NSMutableArray* mArray = [@[] mutableCopy]; for(int i = 0; i < array.count+1; i++) { int r = i - 1; if (r >= 0 && i < array.count) [mArray addObject:@([array[r] integerValue] + [array[i] integerValue])]; else if (i < array.count) [mArray addObject:@(0 + [array[i] integerValue])]; else [mArray addObject:@(0 + [array[i-1] integerValue])]; }

return [mArray copy]; }

I actually had a bit of trouble with this problem, it took a while to iron out the bugs. I copied down the triangle for reference but accidentally had 1 2 2 1 as the third row.

Took me about 15 minutes to do. Doesn't seem like an unreasonable question to ask.