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
@Composable | |
fun ExampleDialog() { | |
val scope = rememberCoroutineScope() | |
val keyboardController = LocalSoftwareKeyboardController.current | |
val focusRequester = remember { FocusRequester() } | |
val textState = remember { mutableStateOf(TextFieldValue()) } | |
LaunchedEffect(Unit) { | |
scope.launch { | |
delay(200) |
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
@Composable | |
fun SelectionPill( | |
option: ToggleButtonOption, | |
selected: Boolean, | |
onClick: (option: ToggleButtonOption) -> Unit = {} | |
) { | |
Button( | |
onClick = { onClick(option) }, | |
colors = ButtonDefaults.buttonColors( | |
backgroundColor = MaterialTheme.colors.background, |
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
const solution = new Set() | |
class Path { | |
constructor(graph) { | |
this.vertices = new Set() | |
this.edges = {} | |
this.distances = {} |
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
fun main() { | |
println(palindromeIndex("aaa")) | |
} | |
fun palindromeIndex(s: String): Int { | |
val reversed = s.reversed() | |
if (s == reversed) return -1 | |
for (i in 0 until s.length) { | |
var countLeft = 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
function flatlandSpaceStations(n, c) { | |
let max = 0 | |
if (n == c.length) { | |
return 0 | |
} | |
for(let i = 0; i < n; i++){ | |
var min = Math.abs(i - c[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
function solve(ip, arr) { | |
let min = 0 | |
let max = ip | |
arr.forEach(tuple => { | |
const i = tuple[0] // 5 | |
const j = tuple[1] | |
if (i > min) { | |
const newMax = i - 1 | |
if (newMax < max){ | |
max = i - 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
tap "adoptopenjdk/openjdk" | |
tap "havoc-io/mutagen" | |
tap "heroku/brew" | |
tap "homebrew/bundle" | |
tap "homebrew/cask" | |
tap "homebrew/cask-versions" | |
tap "homebrew/core" | |
tap "homebrew/services" | |
tap "shopify/shopify" | |
tap "versent/taps" |
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
//: A UIKit based Playground for presenting user interface | |
import UIKit | |
import PlaygroundSupport | |
class MyViewController : UIViewController { | |
override func loadView() { | |
let view = UIView() | |
view.backgroundColor = .white |
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 kotlin.reflect.KClass | |
fun main() { | |
start { | |
factory<Client>{ FakeClient() } | |
factory<Service>{ FakeService(get()) } | |
} | |
val service: Service by inject() | |
service.call() |
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
# Crack the code, and write a function to decode | |
# any new messages you receive from mystery envelopes. | |
def puzzle(encoded_message): | |
encoded_lowercase = encoded_message.lower() | |
plaintext = '' | |
for i in range(len(encoded_lowercase)): | |
ascii = ord(encoded_lowercase[i]) | |
if ascii >= 97 and ascii<=122: |
NewerOlder