You are given two strings
s
andt
of equal lengthn
. You can perform the following operation on the strings
:
- Remove a suffix of
s
of lengthl
where0 < l < n
and append it at the start ofs
.
For example, lets = 'abcd'
then in one operation you can remove the suffix'cd'
and append it in front ofs
makings = 'cdab'
.You are also given an integer
k
. Return the number of ways in whichs
can be transformed intot
in exactlyk
operations.Since the answer can be large, return it modulo
109 + 7
.
c++
1 |
|