Question: Write a static method removeDuplicates(Character[] in) that returns a new array of the characters in the given array, but without any duplicate characters. Always keep
Write a static method removeDuplicates(Character[] in) that returns a new array of the characters in the given array, but without any duplicate characters. Always keep the first copy of the character and remove subsequent ones. For example, if in contains b, d, a, b, f, a, g, a, a, and f, the method will return an array containing b, d, a, f, and g. (Hint: One way to solve this problem is to create a boolean array of the same size as the given array in and use it to keep track of which characters to keep. The values in the new boolean array will determine the size of the array to return.)
Step by Step Solution
3.34 Rating (157 Votes )
There are 3 Steps involved in it
public static Character removeDup... View full answer
Get step-by-step solutions from verified subject matter experts
