Angara interview question

Time Complexity of Above Question