CT1313

The Shared Opening Beneath Goldmeadow

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

At the trading post of Goldmeadow, Surveyor records each banners in a worn leather ledger. The guild wants answers, not guesses. 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| <= 94.

Example 1:

Input: ihobzoipkycelbpjxzhykgimavugddswrohqttjhzxzpv ihobzoipkycelbpjxzhyirpwe
Output: 20

Example 2:

Input: yrbdamfrgdtfwgipwwxvtkqgirlopkmkjcgoxxkvymfwgvlzhpajsgxuzhlmhwcsbyikxohmbhilgopjoriipotkugfa yrbdamfrgdtcp
Output: 11

Example 3:

Input: wcfrgqaictrguvexcxlnb oenwranlwjmbewxvtvqxafx
Output: 0

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
The Shared Opening Beneath Goldmeadow - EASY Coding Problem | CodeTikki