ZS Associates interview question

Dynamic Approach related question was asked