codewars completed
This commit is contained in:
parent
d5be938936
commit
44bc223d18
|
|
@ -1,18 +1,19 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import "fmt"
|
||||||
"fmt"
|
|
||||||
"sort"
|
|
||||||
)
|
|
||||||
|
|
||||||
func ExpressionMatter(a int, b int, c int) {
|
func ending(start, end string) bool {
|
||||||
// your code here
|
// your code here
|
||||||
array := []int{a*(b+c),a*b*c,a+b+c,a+(b*c),(a+b)*c}
|
if start[len(start)-len(end):] == end {
|
||||||
sort.Ints(array)
|
fmt.Println("true")
|
||||||
fmt.Println(array)
|
return true
|
||||||
fmt.Println(array[len(array)-1])
|
}
|
||||||
|
fmt.Println("false")
|
||||||
|
return false
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ExpressionMatter(1,2,4)
|
ending("abc","bc")
|
||||||
|
ending("abc","d")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user