Verbal Arithmetic Puzzle - Practice Coding | SlaveCode
0
0123456789
0
0123456789
:
0
0123456789
0
0123456789
1307. Verbal Arithmetic Puzzle
Hard
50 Points
Array
Math
String
Backtracking
Given an equation, represented by words on the left side and the result on the right side.
You need to check if the equation is solvable under the following rules:
Return true if the equation is solvable, otherwise return false.
Input: words = ["LEET","CODE"], result = "POINT"
Output: false
Explanation: There is no possible mapping to satisfy the equation, so we return false.
Note that two different characters cannot map to the same digit.
Constraints
2 <= words.length <= 5
1 <= words[i].length, result.length <= 7
words[i], result contain only uppercase English letters.
The number of different characters used in the expression is at most 10.
1307. Verbal Arithmetic Puzzle
Hard
50 Points
Array
Math
String
Backtracking
Given an equation, represented by words on the left side and the result on the right side.
You need to check if the equation is solvable under the following rules:
Return true if the equation is solvable, otherwise return false.
Input: words = ["LEET","CODE"], result = "POINT"
Output: false
Explanation: There is no possible mapping to satisfy the equation, so we return false.
Note that two different characters cannot map to the same digit.
Constraints
2 <= words.length <= 5
1 <= words[i].length, result.length <= 7
words[i], result contain only uppercase English letters.
The number of different characters used in the expression is at most 10.