Ant Group Interview Question

String Multiplication problem (leetcode 43)