#K90767. Longest Uncommon Subsequence
Longest Uncommon Subsequence
Longest Uncommon Subsequence
Given two strings (s_1) and (s_2), the task is to determine the length of the longest uncommon subsequence between them. An uncommon subsequence is defined as a sequence that is a subsequence of one string but not the other. In this problem, if (s_1 = s_2), then no uncommon subsequence exists and the output should be (-1). Otherwise, the result is (\max(|s_1|, |s_2|)), where (|s_i|) denotes the length of string (s_i).
inputFormat
The input is given via standard input (stdin) and consists of two lines. The first line contains the string (s_1) and the second line contains the string (s_2). The strings may be empty.
outputFormat
Output a single integer to standard output (stdout), which is the length of the longest uncommon subsequence between (s_1) and (s_2). If no such subsequence exists (i.e., the two strings are identical), output (-1).## sample
abc
abc
-1