Synopsys interview question

Ok DSA , complexity analysis