Minimize the count of characters to be added or removed to make String repetition of same substring

                                function getMin(x, y, z) {            return Math.min(Math.min(x, y), z);        }                                function editDistance(str1, str2, m, n)        {                                 let dp = new Array(m + 1).fill(new Array(n + 1));                        for (let i = 0; i