Can complexity be reduced?

can you please check and tell if the complexity of this code can be reduced and if yes, then how.

@Akshita99 no it cant yours is good enough