CNN Interview Question

time complexity and space for an algo