diff --git a/tests/go/solutions/lcm/main.go b/tests/go/solutions/lcm/main.go index 55c57316..8ffae9b1 100644 --- a/tests/go/solutions/lcm/main.go +++ b/tests/go/solutions/lcm/main.go @@ -10,13 +10,13 @@ import "fmt" func gcd(first, second int) int { if second == 0 { - return (first) + return first } return gcd(second, first%second) } func Lcm(first, second int) int { - return (first / gcd(first, second) * second) + return first / gcd(first, second) * second } func main() { fmt.Println(Lcm(3, 0)) diff --git a/tests/go/solutions/nauuo.go b/tests/go/solutions/nauuo.go index e4235f72..44859576 100644 --- a/tests/go/solutions/nauuo.go +++ b/tests/go/solutions/nauuo.go @@ -10,26 +10,26 @@ package solutions func Nauuo(plus, minus, rand int) string { if rand == 0 { if plus > minus { - return ("+") + return "+" } if plus < minus { - return ("-") + return "-" } if plus == minus { - return ("0") + return "0" } } if plus > minus+rand { - return ("+") + return "+" } if plus+rand < minus { - return ("-") + return "-" } if (plus+rand >= minus) && (plus-rand <= minus) { - return ("?") + return "?" } if (minus+rand >= plus) && (minus-rand <= plus) { - return ("?") + return "?" } - return ("?") + return "?" } diff --git a/tests/go/solutions/nauuo/main.go b/tests/go/solutions/nauuo/main.go index d6366a6d..6547e0a0 100644 --- a/tests/go/solutions/nauuo/main.go +++ b/tests/go/solutions/nauuo/main.go @@ -9,28 +9,28 @@ package main func Nauuo(plus, minus, rand int) string { if rand == 0 { if plus > minus { - return ("+") + return "+" } if plus < minus { - return ("-") + return "-" } if plus == minus { - return ("0") + return "0" } } if plus > minus+rand { - return ("+") + return "+" } if plus+rand < minus { - return ("-") + return "-" } if (plus+rand >= minus) && (plus-rand <= minus) { - return ("?") + return "?" } if (minus+rand >= plus) && (minus-rand <= plus) { - return ("?") + return "?" } - return ("?") + return "?" } func main() { diff --git a/tests/go/solutions/sametree.go b/tests/go/solutions/sametree.go index 85da3585..901af31f 100644 --- a/tests/go/solutions/sametree.go +++ b/tests/go/solutions/sametree.go @@ -23,5 +23,5 @@ func checkIfEq(t1 *TreeNodeL, t2 *TreeNodeL) bool { if t1 == nil || t2 == nil { return false } - return (t1.Val == t2.Val && checkIfEq(t1.Right, t2.Right) && checkIfEq(t1.Left, t2.Left)) + return t1.Val == t2.Val && checkIfEq(t1.Right, t2.Right) && checkIfEq(t1.Left, t2.Left) } diff --git a/tests/go/solutions/sametree/main.go b/tests/go/solutions/sametree/main.go index 5ba2b18c..8beb0e36 100644 --- a/tests/go/solutions/sametree/main.go +++ b/tests/go/solutions/sametree/main.go @@ -23,7 +23,7 @@ func checkIfEq(t1 *TreeNodeL, t2 *TreeNodeL) bool { if t1 == nil || t2 == nil { return false } - return (t1.Val == t2.Val && checkIfEq(t1.Right, t2.Right) && checkIfEq(t1.Left, t2.Left)) + return t1.Val == t2.Val && checkIfEq(t1.Right, t2.Right) && checkIfEq(t1.Left, t2.Left) } func main() { diff --git a/tests/go/solutions/swapbits.go b/tests/go/solutions/swapbits.go index 2bcdf5c8..3e7dd9df 100644 --- a/tests/go/solutions/swapbits.go +++ b/tests/go/solutions/swapbits.go @@ -1,5 +1,5 @@ package solutions func SwapBits(n byte) byte { - return ((n >> 4) | (n << 4)) + return (n >> 4) | (n << 4) }