TEKsystems Interview Question

You are given string s1 = “” and a string s2 = “abcbcaa”

Interview Answer

Anonymous

Sep 5, 2019

You can perform any one of the two operations on s1 : Append a new character to s1. This costs you A dollars. or Append an existing substring of s1 to s1. This costs you B dollars. Find the minimal dollars you need to pay in order to convert s1 to s2. This question involves Dynamic Programming.