Skip to content

Instantly share code, notes, and snippets.

View SergioB-dev's full-sized avatar

Serg SergioB-dev

View GitHub Profile
@SergioB-dev
SergioB-dev / routines.go
Created August 14, 2022 04:24
learning go routines
func checkLink(link string, c chan string) {
10 start := time.Now()
11 _, err := http.Get(link)
12
13 if err != nil {
14 fmt.Println(link, " is not working")
15 return
16 }
@SergioB-dev
SergioB-dev / get_neighbors.py
Created October 25, 2021 15:51
Grid neighbor finder
def get_neighbors(d, x, y, coll):
# d == abbr. for dungeon is our board
# For example:
#[-8, -13, -8]
#[-24, 28, 28]
#[-13, -13, -30]
# coll == abbr. for collection, how I keep track of all returned neighbors
# We start our knight in the upper left hand corner
@SergioB-dev
SergioB-dev / sudoku_solver.py
Created September 30, 2021 00:10
Sudoku Solver | Recursive Backtracking
board = [
[3, 9, -1, -1, 5, -1, -1, -1, -1],
[-1, -1, -1, 2, -1, -1, -1, -1, 5],
[-1, -1, -1, 7, 1, 9, -1, 8, -1],
[-1, 5, -1, -1, 6, 8, -1, -1, -1],
[2, -1, 6, -1, -1, 3, -1, -1, -1],
[-1, -1, -1, -1, -1, -1, -1, -1, 4],
[5, -1, -1, -1, -1, -1, -1, -1, -1],
@SergioB-dev
SergioB-dev / problem.txt
Last active September 6, 2021 15:47
Highest score possible from a given scrabble rack
Word Solver
Part 1
Write some code that:
Takes a 7-character string (either as a command-line argument or as an argument to a function)
Prints out the words that can be made from those characters, along with their Scrabble scores, one word per line, in descending score order
Example input and output:
$ python scrabble_cheater.py SPCQEIU # Use any language you like.
@SergioB-dev
SergioB-dev / gist:ed62f684b86175d1dabc6eddc068c727
Last active August 7, 2021 21:49
Binary Search Trees - Different methods of traversal
class BinaryNode<Element> {
    var value: Element
    var leftChild: BinaryNode?
    var rightChild: BinaryNode?
    
    init(value: Element) {
        self.value = value
    }