CT1930

Farmer and the Shared Opening

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

The council of the temple city of Sunspire pays by the answer, and Farmer intends to earn it. First: the full register of banners. Task: Print the length of the longest common prefix of s and t. Input format: Two lines: string s, then string t. Output format: Print the common prefix length. Constraints: 1 <= |s|,|t| <= 100.

Example 1:

Input: pcmbxcjplsdnbzmtbjjyqyjsoembtoaqgzpejhnpuluuncavdurqbutnmgfzulazswwwhhpzqpz pcmbxcjplsdnbzmtgnqoq
Output: 16

Example 2:

Input: jcllunlgeefzmixnobmoymtyhhgdkzicqdmyrobnqjnp jcllunlgeefzmixnommr
Output: 17

Example 3:

Input: dbqtqalhfhtszenlkkmvhhmvoakdlcdfaxfapy dbqtqanrr
Output: 6

Constraints:

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

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