You are given two strings of equal length. Your task is to generate all “zipper words” that can be produced from them. A zipper word is made by interleaving the characters at the same index from each string. Some indexes may be skipped. However, a zipper word has length at least 2. For example, if the two strings are

ant
bug

then a zipper word is

abtg

Complete the following class to generate an array list of all zipper words.

Hint: (1) There are two kinds of zipper words that can be made of ant and bug: those that start with ab and those that don't. In either case, the suffix is a zipper word made of nt and ug. (2) If the length of the strings is is zero, there are no zipper words.

Complete the following file:

ZipperWordGenerator.java

import java.util.ArrayList; import java.util.Collections; public class ZipperWordGenerator { public ZipperWordGenerator(String word1, String word2) { assert word1.length() == word2.length(); first = word1; second = word2; } public ArrayList<String> getZipperWords() { // your work here } private String first; private String second; // this method is used to check your work public static ArrayList<String> check(String word1, String word2) { ZipperWordGenerator gen = new ZipperWordGenerator(word1, word2); ArrayList<String> r = gen.getZipperWords(); Collections.sort(r); // to make result independent of insertion order return r; } }