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
// https://go.dev/play/p/RKU8IstAlhf | |
// Does close() signals select? Yes | |
// Is channel picked randomly? Yes | |
// If there is long buffered channel with many entries will cancel() / other channel be triggered? Yes | |
package main | |
import ( | |
"fmt" | |
"time" | |
) |
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
// 🍍🍌🥝🍍🍌🥝🍍🍌🥝🍍🍌🥝🍍🍌🥝🍍🍌🥝 | |
// time: O(N) | |
// space: O(1) | |
// Go Playground: https://go.dev/play/p/ZLq6zcsG6lw | |
// why: making smoothie! 🍧 | |
package main | |
import ( | |
"fmt" | |
"math/rand" |
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
// 🎄🎄🎄🎄🎄🎄🎄🦌🦌🦌🦌🦌🦌🦌🦌🦌🎅🏻🎁🎁🎁🎄🎄🎄🎄 | |
// time: O(N) | |
// space: O(1) | |
// Go Playground: https://go.dev/play/p/1g8m82vmuuu | |
// why: Merry Christmas! | |
package main | |
import "fmt" | |
type Node struct { |
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
// Go Playground: https://go.dev/play/p/DMiZPwRUGWD | |
// time: O(N) | |
// space: O(1) | |
// why: Just For Fun! 🤪 | |
package main | |
import "fmt" | |
type Node struct { | |
V string |
NewerOlder