2645. Minimum Additions to Make Valid String
Given a string
word
to which you can insert letters “a”, “b” or “c” anywhere and any number of times, return the minimum number of letters that must be inserted so thatword
becomes valid.A string is called valid if it can be formed by concatenating the string “abc” several times.
1 | class Solution { |