public String helper(String str, int n) {
        StringBuilder strBuilder = new StringBuilder();

        if (str == null) {
            return null;
        }

        for (int i = 0; i < n; i++) {
            strBuilder.append(str);
        }

        return strBuilder.toString();
    }