Question: Do not use arrays on a problem involving Strings, and do not use Strings in a problem involving arrays. you must not use either break

Do not use arrays on a problem involving Strings, and do not use Strings in a problem involving arrays.
you must not use either break or continue in your code.
You are allowed to use the following methods from the Java API:
- class String
- length
- charAt
- class StringBuilder
- length
- charAt
- append
- toString
- class Character
- any method
2. subtract takes two Strings and returns a String: The output string should be the same as the first input string except that you should remove the characters of the second string as follows: remove the first occurrence of the first character, the first occurrence of the second character that appears after the removed character, the first occurrence of the third character that appears after the first two removed characters, etc. If there is no such character to remove, then nothing further is removed. HW2.subtract("gfedcbabcdefg", "acfa") "gfedcbbdeg
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
