remove duplicates Algorithm
After cutting, the new key is deburred: scrubbed with a metal brush to remove burrs, small pieces of metal remaining on the key, which, were they not removed, would be dangerously sharp and, further, foul locks. Different key cutting machines are more or less automated, use different milling or grinding equipment, and follow the design of early 20th century key duplicators.
//
// CPP program to remove duplicate character
// from character array and print in sorted
// order
//
// The All ▲lgorithms Project
//
// https://allalgorithms.com/strings
// https://github.com/allalgorithms/cpp
//
// Contributed by: Tushar Kanakagiri
// Github: @tusharkanakagiri
//
#include <iostream>
using namespace std;
char *removeDuplicate(char str[], int n)
{
// Used as index in the modified string
int index = 0;
// Traverse through all characters
for (int i = 0; i < n; i++)
{
// Check if str[i] is present before it
int j;
for (j = 0; j < i; j++)
if (str[i] == str[j])
break;
// If not present, then add it to
// result.
if (j == i)
str[index++] = str[i];
}
return str;
}
// Driver code
int main()
{
char str[] = ""; //Enter string here
int n = sizeof(str) / sizeof(str[0]);
cout << removeDuplicate(str, n);
return 0;
}