マツシタのお勉強

String Buffer

'a'と'b'でパターンマッチ

問題 文字列wordとパターンを表すpatternが入力値として与えれる。patternは'a'と'b'のみで構成されている。wordがpatternにマッチするか否かを求める問題。 例 word = “catcatgocatgo”, pattern = “abbab” a -> cat b -> go とすればwordはpatternにマッチ…

Compress a String

Problem Implement a method to perform basic string compression using the counts of repeated characters. For example, the string aabcccccaaa would become a2b1c5a3. If the string would not become smaller than the original string, your method…