Solución
solution.tsTypeScript
export function commonChars(a: string, b: string): number {
let count = 0
let isMoreLarge = a.length > b.length ? a.toLowerCase().split('') : b.toLowerCase().split('')
let isLessLarge = a.length > b.length ? b.toLowerCase().split('') : a.toLowerCase().split('')
for(let word of isMoreLarge) {
if(isLessLarge.includes(word)){
count++
}
}
return count
}
0respuestas