Implement a function named is_result_correct that determines if a given result can be obtained from a list of words by assigning distinct digits to each character.
Functionality
The function should:
Take two parameters:
words: A list of strings, where each string represents a word consisting of lowercase letters.
result: A string representing the potential resulting word derived from the summation of the words in words.
Return a boolean value:
True if it is possible to assign distinct digits (0-9) to each letter in such a way that the sum of the numeric values of all the words in words equals the numeric value of result.
False otherwise.
Input/Output Requirements
Input:
words: List of strings (1 ≤ len(words) ≤ 10, 1 ≤ len(word) ≤ 10)
result: A string (1 ≤ len(result) ≤ 10)
Output:
A boolean value (True or False).
Example
python
# Example input
words = ["send", "more"]
result = "money"
# Expected output
is_result_correct(words, result) # Should return True
Implementation
The solution must be written in a file called /app/solution.py.