// Java program to remove duplicates
import java.util.*;
class BagInterface
{
/* Function removes duplicate characters from the string
This function work in-place */
void Baginterface(String str)
{
LinkedHashSet lhs = new LinkedHashSet<>();
for(int i=0;i
Solution
// Java program to remove duplicates
import java.util.*;
class BagInterface
{
/* Function removes duplicate characters from the string
This function work in-place */
void Baginterface(String str)
{
LinkedHashSet lhs = new LinkedHashSet<>();
for(int i=0;i

Java program to remove duplicatesimport java.util.;class Bag.pdf

  • 1.
    // Java programto remove duplicates import java.util.*; class BagInterface { /* Function removes duplicate characters from the string This function work in-place */ void Baginterface(String str) { LinkedHashSet lhs = new LinkedHashSet<>(); for(int i=0;i Solution // Java program to remove duplicates import java.util.*; class BagInterface { /* Function removes duplicate characters from the string This function work in-place */ void Baginterface(String str) { LinkedHashSet lhs = new LinkedHashSet<>(); for(int i=0;i