Answer: Standard Chartered, On-Campus Questions Asked on 31st October, 2022, SET-1

Answer · Posted Nov 2022

Solution for question 3 This problem can be solved using some observation and dp. Firstly, if lengths of src and target string are not equal, then answer will be 0. Now, let n be the length of src and target strings, and f(x, k) = number of ways to obtain a string with shift x, in k operations, w.r.t. src string. First we will observe that if k = 0, then f(1,k) = f(2,k) = … f(n-1,k) = 0, and ...

The full answer & interview discussion are available to premium members.

Log in Create a free account