CF1968B Prefiquence

Description

You are given two binary strings $ a $ and $ b $ . A binary string is a string consisting of the characters '0' and '1'. Your task is to determine the maximum possible number $ k $ such that a prefix of string $ a $ of length $ k $ is a subsequence of string $ b $ . A sequence $ a $ is a subsequence of a sequence $ b $ if $ a $ can be obtained from $ b $ by the deletion of several (possibly, zero or all) elements.

Input Format

N/A

Output Format

N/A

Explanation/Hint

In the first example, the string ' $ 10 $ ' is a subsequence of ' $ 1\color{red}11\color{red}0 $ ' but the string ' $ 100 $ ' is not. So the answer is $ 2 $ . In the fifth example, $ a $ =' $ 100 $ ', $ b $ =' $ 1\color{red}{10}1\color{red}0 $ ', whole string $ a $ is a subsequence of string $ b $ . So the answer is $ 3 $ . In the sixth example, string $ b $ does not contain ' $ 1 $ ' so the answer is $ 0 $ .