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
class EditSettingsVM { | |
struct Inputs { | |
let reload = PublishSubject<Void>() | |
let updateSetting = PublishSubject<(SettingKey, SettingValue)>() | |
let reset = PublishSubject<Void>() | |
let dismiss = PublishSubject<Void>() | |
let updateEnumSetting = PublishSubject<(SettingKey, EnumSettingValue)>() | |
} |
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
import Foundation | |
struct Range: Hashable { | |
let start: Int | |
let end: Int | |
var count: Int { | |
return (end - start) + 1 | |
} | |
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
class Solution { | |
var perf = 0 | |
var perf2 = 0 | |
var hitCache = 0 | |
func longestPalindrome(_ s: String) -> String { | |
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
class Solution { | |
var perf = 0 | |
var perf2 = 0 | |
var hitCache = 0 | |
func longestPalindrome(_ s: String) -> String { | |
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
class Solution { | |
var perf = 0 | |
func longestPalindrome(_ s: String) -> String { | |
var cache = [Range: String]() | |
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
// | |
//NonEmpty | |
//DataSiteOne | |
// | |
//Created by Huang, Eric on 4/12/18 | |
//Copyright © 2018 Merrill Corporation. All rights reserved. | |
import Foundation | |
public protocol NonEmpty { |
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
import Foundation | |
extension String { | |
func safeStr(i: Int) -> String { | |
guard i >= 0 && i < self.count else { | |
fatalError() | |
} | |
return String(self[self.index(self.startIndex, offsetBy: i)]) | |
} | |
func str(s: Int, e: Int) -> String { |
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
import Foundation | |
extension String { | |
func safeStr(i: Int) -> String { | |
guard i >= 0 && i < self.count else { | |
fatalError() | |
} | |
return String(self[self.index(self.startIndex, offsetBy: i)]) | |
} | |
func str(s: Int, e: Int) -> String { |
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
import Foundation | |
extension String { | |
func safeStr(i: Int) -> String { | |
guard i >= 0 && i < self.count else { | |
fatalError() | |
} | |
return String(self[self.index(self.startIndex, offsetBy: i)]) | |
} | |
func safeChar(i: Int) -> Character { |
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
import Foundation | |
extension String { | |
func safeStr(i: Int) -> String { | |
guard i >= 0 && i < self.count else { | |
fatalError() | |
} | |
return String(self[self.index(self.startIndex, offsetBy: i)]) | |
} | |
func safeChar(i: Int) -> Character { |