Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package main
import "fmt"
func main() {
var n int
fmt.Scan(&n)
a := make([]int, n)
for i := 0; i < n; i++ {
fmt.Scan(&a[i])
}
res := 0
loop := true
for {
for i := 0; i < len(a); i++ {
if a[i] == 0 || a[i]%2 == 1 {
loop = false
break
} else {
a[i] = a[i] / 2
}
}
if !loop {
break
}
res++
}
fmt.Printf("%v", res)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.