Problem Description
Our company wants to create a data entry verification system. Given an amount in words and an amount indicated by data entry person in numbers, you have to
detect whether the amounts are the same or not.Note:
- There are a lot of corner cases to be considered. The interviewer expects you to take care of them.
- Every word needs to be separated using "-" rather than a space character https://en.wikipedia.org/wiki/Indian_numbering_system
- "Use Expected Output option" to clear further doubts.
Problem Constraints
1 <= |A| <= 9
1 <= |B| <= 100
Input Format
String num: Amount written in digits as a string. This string will be an integer number without having any commas in between the digits.
String words: Amount written in words according to Indian Numbering System.
Output Format
An integer
1: Values match
0: Otherwise
Example Input
String num = "1234"
String words = "one-thousand-two-hundred-and-thirty-four"
Example Output
1
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified.
Still have a question? Checkout Sample Codes for more details.