I hereby claim:
- I am vikmeup on github.
- I am vikmeup (https://keybase.io/vikmeup) on keybase.
- I have a public key ASCBVagsVv63-cn9_uugHFFfMGjj5aIrnGiVDhjxDm-L0go
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| func generate(numRows: Int) -> [[Int]] { | |
| var results = [[Int]]() | |
| if (numRows == 0) { | |
| return results | |
| } | |
| for i in 0..<numRows { | |
| var currentResults = [Int]() | |
| for j in 0...i { | |
| if (i > 1 && j > 0 && j < i) { | |
| let value = results[i-1][j] + results[i-1][j-1] |
| func removeDuplicates(inout nums: [Int]) -> Int { | |
| var dict = Dictionary<Int,Int>() | |
| var repeatedCount = 0 | |
| for i in 0..<nums.count { | |
| let curIndex = i-repeatedCount | |
| let v = nums[curIndex] | |
| if let value = dict[v] { | |
| dict[v] = value + 1 | |
| if (value > 1) { | |
| repeatedCount += 1 |
| func flipMatrix(inout matrix: [[Int]]) { | |
| let n = matrix.count | |
| for i in 0..<n { | |
| for j in i+1..<n { | |
| let temp = matrix[i][j] | |
| matrix[i][j] = matrix[j][i] | |
| matrix[j][i] = temp | |
| } | |
| } | |
| } |
| func isValid(s: String) -> Bool { | |
| struct Stack<Element> { | |
| var items = [Element]() | |
| mutating func push(item: Element) { | |
| items.append(item) | |
| } | |
| mutating func pop() -> Element { | |
| return items.removeLast() | |
| } | |
| } |
| func isPalindrome(s: String) -> Bool { | |
| let cleanString = s.componentsSeparatedByCharactersInSet(NSCharacterSet.alphanumericCharacterSet().invertedSet).joinWithSeparator("") | |
| return Bool(String(cleanString.characters).lowercaseString == String(cleanString.characters.reverse()).lowercaseString) | |
| } |
| class Solution { | |
| func compareVersion(version1: String, _ version2: String) -> Int { | |
| var v1 = version1.characters.split(".").map { Int(String($0)) } | |
| var v2 = version2.characters.split(".").map { Int(String($0)) } | |
| var result = 0 | |
| for i in 0..<max(v1.count,v2.count) { | |
| let left = i >= v1.count ? 0 : v1[i] | |
| let right = i >= v2.count ? 0 : v2[i] | |
| if (left == right) { |
I hereby claim:
To claim this, I am signing this object:
| Title: | |
| Scroll Feed: Reader of interesting and funny news, facts, photos, video, articles | |
| Keywords: | |
| social,9gag,fun,science,girls,vintage,fashion,art,rss,magazine,read,travel,music,tech,sport,abc,cnn | |
| Description: |
| <?php | |
| $apnsHost = 'gateway.sandbox.push.apple.com'; | |
| $apnsCert = 'apns-dev.pem'; | |
| $apnsPort = 2195; | |
| $streamContext = stream_context_create(); | |
| stream_context_set_option($streamContext, 'ssl', 'local_cert', $apnsCert); | |
| $apns = stream_socket_client('ssl://' . $apnsHost . ':' . $apnsPort, $error, $errorString, 2, STREAM_CLIENT_CONNECT, $streamContext); |