This file contains hidden or 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
| #!/usr/bin/env bash | |
| rm -rf "${HOME}/Library/Caches/CocoaPods" | |
| rm -rf "`pwd`/Pods/" | |
| pod update |
This file contains hidden or 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
| // Make sure to include this at the top of AppDelegate.m | |
| @import UserNotifications; | |
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
| // Override point for customization after application launch. | |
| // Check Notification Settings on launch | |
| [[UNUserNotificationCenter currentNotificationCenter] getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) { | |
| switch (settings.authorizationStatus) { | |
| // This means we have not yet asked for notification permissions | |
| case UNAuthorizationStatusNotDetermined: |
This file contains hidden or 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
| function arrayManipulation(n, queries) { | |
| // Write your code here | |
| var arr = Array(n + 1).fill(0); | |
| var max = 0; | |
| var x = 0; | |
| for(var query of queries) { | |
| const [a, b, k] = query; | |
| arr[a] += k; | |
| if(b+1 <= n) { | |
| arr[b+1] -= k; |
This file contains hidden or 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
| // Complete the minimumSwaps function below. | |
| function minimumSwaps(arr) { | |
| var swaps = 0; | |
| for(var i=0; i< arr.length; i++) { | |
| while(arr[i] !== i + 1) { | |
| let j = arr[i] - 1; | |
| let tem = arr[i]; | |
| arr[i] = arr[j]; | |
| arr[j] = tem; | |
| swaps ++; |
This file contains hidden or 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
| function Node(key) { | |
| this.key = key; | |
| this.left = null; | |
| this.right = null; | |
| this.parent = null; | |
| } | |
| function BSTree() { | |
| this.root = null; | |
| } |
This file contains hidden or 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
| class TrieNode { | |
| var key: Character? | |
| var children: [Character: TrieNode] = [:] | |
| weak var parent: TrieNode? | |
| var end: Bool | |
| init(_ key: Character?) { | |
| self.key = key | |
| self.children = [:] | |
| self.parent = nil | |
| self.end = false |
This file contains hidden or 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
| class TrieNode { | |
| constructor(key) { | |
| this.key = key; | |
| this.parent = null; | |
| this.children = {}; | |
| this.end = false; | |
| } | |
| }; | |
| class Trie { |
This file contains hidden or 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
| try? self.navigate(screen: "user_xxx") |
This file contains hidden or 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 MAFNavigationRegistry | |
| import UserModule | |
| class ApplicationNavigationController: UINavigationController, MAFNavigationRegistry { | |
| var registry: [String : MAFModuleRegistry] = [ | |
| "user": UserModule.userModuleRegistry, | |
| "system": SystemModule.systemModuleRegistry | |
| ] | |
| } |
NewerOlder