Problem-link : — https://www.hackerearth.com/practice/algorithms/dynamic-programming/2-dimensional/practice-problems/algorithm/shift-the-array-4074fac2/
You are given a string that contains lowercase English letters. In one step, you can choose a character and assign the next letter in the alphabet to it. (a-->b,b-->c,etc..and yea,z--->a). The number of indices where a[i]!=a[i+1] is given as f(string).
You are given a number 'k'.Now, your task is to determine the minimum number of steps required to perform on the string to obtain a string such that f(new-string)<=k.