Skip to content

Instantly share code, notes, and snippets.

View go-cristian's full-sized avatar
💭
Never stop learning!

Cristian Gómez go-cristian

💭
Never stop learning!
View GitHub Profile
xkjhf sdwf iajudsf ds
Post 4
Hshdbdudbdjdh
@go-cristian
go-cristian / main.kt
Last active December 21, 2019 18:30
main
fun getTimes(times: Array<Int>, directions: Array<Int>): Array<Int> {
val result: Array<Int> = Array(times.size) { -1 }
val endTime: Int = times.max() ?: 0
if (endTime == 0) return result
val inQueue: Queue<Int> = LinkedList()
val outQueue: Queue<Int> = LinkedList()
var currentIndex = 0
var turnstile = 0
@go-cristian
go-cristian / family.kt
Last active December 28, 2019 15:52
Code for medium post, Intro to FP
val cristian = Persona(nombre="Cristian", apellido="Gomez")
val carlos = Persona(nombre="Carlos", apellido="Gomez")
val carmen = Persona(nombre="Carmen", apellido="Gomez")
val spock = Perro(nombre="Spock")
val familia:Familia = listOf(cristian, carlos, carmen, spock)
sealed class Integrante
data class Persona(
val nombre: String, val apellido: String
) : Integrante()
data class Perro(val nombre: String) : Integrante()
typealias Familia = List<Integrante>
const from = PAGE_SIZE * page
let accumulator = 0
let assigned = 0
let currentCityIndex = 0
let currentCityPage = 0
let pages: number[] = []
let results: Listing[] = []
while (assigned < PAGE_SIZE || currentCityIndex === CITIES.length - 1) {
const response = await axios.get(
# 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:
import kotlin.reflect.KClass
fun main() {
start {
factory<Client>{ FakeClient() }
factory<Service>{ FakeService(get()) }
}
val service: Service by inject()
service.call()
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
class MyViewController : UIViewController {
override func loadView() {
let view = UIView()
view.backgroundColor = .white