https://leetcode.com/problems/check-if-word-equals-summation-of-two-words/



Runtime: 76 ms, faster than 87.50% of TypeScript online submissions for Check if Word Equals Summation of Two Words.

Memory Usage: 44.9 MB, less than 6.25% of TypeScript online submissions for Check if Word Equals Summation of Two Words.



```typescript
function isSumEqual(firstWord: string, secondWord: string, targetWord: string): boolean {
    //8:07
    let alphabet = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',
  'M', 'N', 'O', 'P', 'Q', 'R',  'S', 'T', 'U', 'V', 'W', 'X',
  'Y', 'Z' ]
    alphabet = alphabet.map((char:any)=>{
        return char.toLowerCase()
    })
    
    const getNumberFromString = (str: string) => {
        const numbers = []
        for (const char of str.split('')) {
            numbers.push(alphabet.indexOf(char).toString())
        }
        const numberString = numbers.join('')
        return Number(numberString)
    }
    
    return (getNumberFromString(firstWord) + getNumberFromString(secondWord)) == getNumberFromString(targetWord)
    //8:14
};
```

