function getIntersection(str1, str2) {
// Convert strings to sets to remove duplicates
const set1 = new Set(str1);
const set2 = new Set(str2);
// Find the intersection
const intersection = [...set1].filter(char => set2.has(char));
// Return the result as a string
return intersection.join('');
}
const string1 = "php";
const string2 = "python";
console.log(getIntersection(string1, string2));
/*
run:
ph
*/