CT350

Ivan and the Lex Order

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

It is audit day at the maple sugarbush of Saprun. Ivan spreads the letters records across the table and picks up a sharp pencil. 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| <= 161.

Example 1:

Input: gteswpxhxrzfwztojxcljgwpaslbcfzejqzxbugvswjpetdazjsmudleikafpoghrajiwcqjaripnerdlpetvjpjouqhijtrsblpwe wvequdhomitmwqrhdzjlblxgdwuassssfiwvbaskjdl
Output: -1

Example 2:

Input: flcluffvmljkjyvgbiyffvgpjnwkzs foeqcqdwvooqhpftobhibhrhorzjjjvwbteqsiamumgcnxyixcvbdmlmwwfgpkrgmhwnfyrejozgrpdjpvzozerwonllmjupbjtmtmgptyqkbmdyelryxzcrpglgtnkuvjrrykyivfoiwhbutxatreailapsp
Output: -1

Example 3:

Input: nrpolwexwdlpvkchdobszvkmflcimlksivurofdgpzvnvlilxolhetfm csayvpsomimtstblkusdcriewqbrknuxwdnsufbjofbocxzitttmisygeixkivvwnspwslrbeueoxnnt
Output: 1

Constraints:

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

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