-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.go
62 lines (56 loc) · 1.03 KB
/
test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
package main
import (
"fmt"
"reflect"
)
func check(blocks map[string]string, token string) map[string]string {
/**
* Escribe aquí tu solución leyendo el argumento que recibe
* Y retorna el resultado correctamente ordenado
* Según el ejemplo provisto, seria...
*/
return map[string]string{
"0": "f319",
"1": "46ec",
"2": "c1c7",
"3": "3720",
"4": "c7df",
"5": "c4ea",
"6": "4e3e",
"7": "80fd",
}
}
func main() {
/**
* Lo que esperamos recibir
*/
expected := map[string]string{
"0": "f319",
"1": "46ec",
"2": "c1c7",
"3": "3720",
"4": "c7df",
"5": "c4ea",
"6": "4e3e",
"7": "80fd",
}
/**
* Secuencia de bloques desordenados
*/
blocks := map[string]string{
"0": "f319",
"1": "3720",
"2": "4e3e",
"3": "46ec",
"4": "c7df",
"5": "c1c7",
"6": "80fd",
"7": "c4ea",
}
result := check(expected, "b93ac073-eae4-405d-b4ef-bb82e0036a1d")
if reflect.DeepEqual(result, expected) {
fmt.Println("Lo resolviste correctamente")
} else {
fmt.Println("Todavía puedes intentarlo")
}
}