Created
February 1, 2019 14:49
-
-
Save melkael/cad64b246e8ed51eabae3b120f2a4221 to your computer and use it in GitHub Desktop.
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
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