CT763

Honeyed verses Shared Opening

EasyL2 · Byte BanditAcceptance: 0.0%XP: 10

At the anvil district of Hammerfall, Bram records each verses 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| <= 82.

Example 1:

Input: omivfptcqhryerrsiltjvggtunjaawjiywghbrtdkfwatwoggsjrfzzdgbfb omivfptlb
Output: 7

Example 2:

Input: lxjbubugdfnreijilbkzrtma lxjbubeeoa
Output: 6

Example 3:

Input: wkecsnmxoqyjmnbtuuozvrbivmrwihfatjvzkondpjnwb xmsknxt
Output: 0

Constraints:

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

Loading...
Test Cases:No test cases
No test cases available.
Honeyed verses Shared Opening - EASY Coding Problem | CodeTikki