[Solved] String Comparison

$25

File Name: String_Comparison.zip
File Size: 160.14 KB

SKU: [Solved] String Comparison Category: Tag:
5/5 - (1 vote)

Problem Description

Given 2 strings of the same size, determine which string is lexicographically smaller. In this problem, you can assume that the letters case does not matter, i.e. the uppercase letter is the same as the corresponding lowercase letter. Output:

  • if string1 equals to string2.
  • if string1 is lexicographically smaller than string2
  • if string2 is lexicographically smaller than string1.

The strings contain only uppercase and lowercase Latin letters.

Input

The first line of the input contains string1.

The second line of the input contains string2.

The length of both strings does not exist 100. (1 <= |string1|, |string2| <= 100).

Output

Output 0, 1, or 2 based on the comparison described above.

Sample Input 1 aAaAAA

Sample Output 1

0

Sample Input 2 zAz zAd

Sample Output 2

2

Sample Input 3 aBcDeF FeDaBc

Sample Output 3

1

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] String Comparison
$25