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
// Package main provides numerous implementations of functions for calculating | |
// the nth Fibonacci number - detailing their time and space complexities as | |
// well as their limitations on how large of n they can actually compute. | |
// Playground link: https://go.dev/play/p/mW_-C9mRr5u | |
package main | |
import ( | |
"fmt" | |
"math" | |
"math/big" |
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 os | |
# List of modules to check for no access and limited access | |
no_access_modules = [ | |
"rand", | |
"std::fs", | |
"std::net", | |
"std::future", | |
"std::process", | |
"std::sync", |
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
// quicksort sorts in place the given slice by first finding | |
// a correctly placed pivot point and then recursively sorting | |
// the subarrays left and right of the pivot elements | |
// go.dev/play run this code: https://go.dev/play/p/9SJRhamZO_Q | |
func quicksort(array []int) []int { | |
if len(array) <= 1 { | |
return array | |
} | |
// Choose the initial cursors as the first and last indexes | |
c1 := 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
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
crand "crypto/rand" | |
"encoding/base64" | |
"encoding/hex" | |
"encoding/json" | |
"errors" |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"math/big" | |
"os" | |
"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
package main | |
import ( | |
"fmt" | |
"math" | |
"math/big" | |
"math/rand" | |
"sort" | |
"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
const range = (size, startAt = 0) => { | |
return [...Array(size).keys()].map(i => i + startAt); | |
}; | |
const includedIn = (v, ...arrays) => { | |
let arr = []; | |
for (let i = 0; i < arrays.length; i++) { | |
if (arrays[i].includes(v)) { | |
arr.push(arrays[i]); | |
} |