CT974

Zara's labels Shared Opening

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

Zara found an old ledger of labels in the customs house attic at the mangrove channels of Rootwater. The margin notes pose a precise question. 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| <= 150.

Example 1:

Input: jsvcjrbchgecrwboedadrrdpujlocxzqbzozydincrbsheuqesukoprewybcbufrcasvyuxrveuwcrorblhrhquaremetfgrixujpuyfdekbscocscxvwcfiipkcrduosehxbpoyerczbuwnagxtl mnz
Output: 0

Example 2:

Input: rlazjzutcidswoqveyilbwrngcufhpdenzmvlyewyfsykwrjjlxetsfdbmwftbfxxzfilofqciiovrdejqnwqpwuugaevnoivcvjxrvb rlazjzutcidswoqveyilbwrngcufhpdenzmvlyewyfsyklkrzj
Output: 45

Example 3:

Input: lthytpanqydgtxmiexyxulrsostrezpdzdhcrkmgcwzeymoekvfkctmqydfflgfpqcprhroipjlgkajgrbbyupoesinqmrtirumhsdgezyfy lthytpanqydgtxmiexyxulrsostexjb
Output: 27

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Zara's labels Shared Opening - EASY Coding Problem | CodeTikki