You are viewing a single comment's thread. Return to all comments →
Go solution
var min int64 = 0 var max int64 = 0 for i := 0; i < len(arr); i++ { var s int64 = 0 for j := 0; j < len(arr); j++ { if j == i { continue } s = s + int64(arr[j]) } if i == 0 { min = s max = s } if s > max { max = s } if s < min { min = s } } fmt.Printf("%d %d\n", min, max)
Seems like cookies are disabled on this browser, please enable them to open this website
Array Reversal
You are viewing a single comment's thread. Return to all comments →
Go solution