This file contains 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
func isNestedString(_ S : String) -> Bool { | |
if S.isEmpty { | |
return true | |
} | |
var stack: [Character] = [Character]() | |
for elem in S { | |
if elem == "(" { | |
stack.append(elem) |
This file contains 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
func longestCommonPrefix(_ strs: [String]) -> String { | |
// base case | |
if strs.isEmpty { | |
return "" | |
} | |
if var prefixStr = strs.first { | |
for index in 1..<strs.count { | |
let str = strs[index] |
This file contains 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
func calculateAliveFish(_ A : inout [Int], _ B : inout [Int]) -> Int { | |
if A.isEmpty { | |
return 0 // base case | |
} | |
var stack: [Int] = [Int]() | |
var survivals: Int = 0 | |
for (index,elem) in A.enumerated() { | |
if B[index] == 0 { |
This file contains 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
struct ServiceResources { | |
static let exchangeUri = "https://api.exchangeratesapi.io/latest" | |
} | |
enum Currency: String { | |
case euro = "EUR" | |
case pound = "GBP" | |
case dollar = "USD" | |
case turkishLira = "TRY" |
This file contains 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
#install Java JDK | |
sudo yum install java-1.8.0-openjdk.x86_64 | |
#download signing key | |
rpm --import https://packages.elastic.co/GPG-KEY-elasticsearch | |
#create repo file | |
sudo vi /etc/yum.repos.d/elasticsearch.repo | |
#paste repo configurations |
This file contains 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
Show hidden characters
{ | |
"Seti_tabs_small": true, | |
"always_show_minimap_viewport": true, | |
"bold_folder_labels": true, | |
"caret_extra_width": 1, | |
"caret_style": "phase", | |
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme", | |
"fade_fold_buttons": false, | |
"find_selected_text": true, | |
"fold_buttons": true, |