CT1168

The Lex Order Beneath Palemere

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Shepherd runs the gallery at the salt flats of Palemere. Today the books show a list of letters, and the numbers must be worked out before sundown. Task: Compare s and t lexicographically: print -1 if s<t, 0 if s==t, 1 if s>t. Input format: Two lines: string s, then string t. Output format: Print -1, 0, or 1. Constraints: 1 <= |s|,|t| <= 130.

Example 1:

Input: vzahmcvsgihavmryorfxpewcfmpqpdtnmrtcretnuoppxqjupnnhkzbpojzpldezoypijycya rufpsvbabewtyqtqcbnnrgcjxedezwelbfqvylxvmvttiwchgomgfequvauoiqkveozegtcvmnnswaunrqmlravhbsuzxwlmauxvnntexlahjwcrxtgmhplk
Output: 1

Example 2:

Input: yhjwnrgwbndhcaievgavzgcoubyyutmdcssdjtavjbegvbstcdytznp kyhyoialkudgvigdoozpkckuxidbwgamqwywzmtzhugvqcvpxygckyebyxgxbmna
Output: 1

Example 3:

Input: aedakucvoppgjowncukqlygsasafwmvpzkxcwnxtxdpcyndtpqgmsygtrhnndlilgvhndvkiuqodqip cxaixuufipzurxqccdfitjvmlrtttlvuatszpxjospqbogavldehzfjbednhzkksyquvqca
Output: -1

Constraints:

1 <= |s|,|t| <= 130.

Loading...
Test Cases:No test cases
No test cases available.