I hereby claim:
- I am patrickvienne on github.
- I am patrickzimt (https://keybase.io/patrickzimt) on keybase.
- I have a public key ASAGP73Zic0JT3kgt-UGeNVVS6m7xjkdUM6z9ajgbyLv2wo
To claim this, I am signing this object:
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>FakeBook</title> | |
</head> | |
<body> |
I hereby claim:
To claim this, I am signing this object:
package ringbuffer_safe | |
import ( | |
"log" | |
"os" | |
"os/signal" | |
"runtime" | |
"sync/atomic" | |
"time" | |
) |
[user] | |
email = [email protected] | |
name = PatrickVienne | |
[push] | |
default = upstream | |
[core] | |
trustctime = false | |
editor = vim | |
autocrlf = input | |
filemode = false |
package towerofsevens | |
/* | |
Task: | |
Find a fast way, to determine whether a number (any int32 integer) is a power of 7? | |
Example Input and Output: | |
TowerOfSevens(-7) -> false | |
TowerOfSevens(0) -> false | |
TowerOfSevens(1) -> true |
package towerofseven | |
import ( | |
"testing" | |
) | |
// greatest power of seven within the range of int32 | |
const sevenPowEleven = 1977326743 | |
// returns whether an integer number 'n' == 7**int(x) (a positive integer power of 7) |
package rand7 | |
import ( | |
"math/rand" | |
"testing" | |
) | |
func rand5() int { | |
return rand.Intn(5) + 1 | |
} |
// https://leetcode.com/problems/remove-element/description/ | |
func removeElement(nums []int, val int) int { | |
if len(nums) == 0 { | |
return 0 | |
} | |
writeptr := len(nums)-1 | |
readptr := 0 | |
// replace val with number from the back |
package d1 | |
import ( | |
"bufio" | |
"io" | |
"regexp" | |
"unicode/utf8" | |
) | |
func Must(err error) { |
package d2 | |
import ( | |
"bufio" | |
"bytes" | |
"io" | |
"regexp" | |
"strconv" | |
) |