IBM interview question

what are the time complexity of the given code(dynamic programming codes where asked)