ProghubPH

What is the time complexity of the following function?

 single option
func foo(a, N int) int {
	i := N

	for i > 0 { // while (i > 0)
		a += i
		i /= 2
	}

	return a
}
O(N)
O(Sqrt(N))
O(N / 2)
O(log N)