leetcode multiply strings refactoring