Minimum Insertions for Valid String
You are given a string 'word'. Your task is to insert the letters 'a', 'b', or 'c' anywhere and any number of times into the string 'word' to make it a valid string. A valid string is one that can be formed by concatenating the string "abc" several times. Return the minimum number of letters that must be inserted to make 'word' valid.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)