Meta interview question

Is it the otimize solution? What time complexity that solution?