Google Interview Question

Some array stuffs. Let me calculate the array and then to improve it.