Synopsys Interview Question

Ok DSA , complexity analysis