Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
func countDuplicates(elem [10][]byte) int {
tmp := elem
ret := 0
for i := range tmp {
for j := range elem {
if i != j && reflect.DeepEqual(tmp[i], elem[j]) {
ret++
}
}
}
return ret
}
func main() {
f, _ := os.Open("8.txt")
fs := bufio.NewScanner(f)
for fs.Scan() {
txt := fs.Text()
e := strToBlockArray(txt)
if countDuplicates(e) != 0 {
fmt.Println("Challenge 8,the encoded block is :", txt)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.