P19814 [GeeksforGeeks] Compare two large numbers3413
普及-
题目描述

You will be given two numbers a and b. Your task is to print 1 if a < b, print 2 if a > b and print 3 if a = b.
Example 1:
Input:
a = 1234
b = 12345
Output: 1
Explanation: a < b so answer is 1.
Example 2:
Input:
a = 100
b = 1
Output: 2
Explanation: a > b, so answer is 2.
User Task:
Your task is to complete the function check() which takes 2 arguments(string a, string b) and returns the answer. You need not take input or print anything.
Expected Time Complexity: O(|a| + |b|).
Expected Auxiliary Space: O(|a| - |b|).
Constraints:
1 ≤ |a|, |b| ≤ 155^{ }
'0' ≤ a_{i},b_{i } ≤ '9'

输入格式

见题面

输出格式

见题面

样例输入
a = 1234 b = 12345
样例输出
1