Pergunta de entrevista da empresa Neebal Technologies

Asked to explain time complexity and space complexity of each code?