Shortest Uncommon Subsequence

1. You are given two strings S1 and S2.
2. You have to find length of the shortest subsequence in S1 which is not a subsequence in S2.
3. If no such subsequence exists, then print '-1'.
Input Format
Two Strings S1 and S2
Output Format
A number representing the length of shortest uncommon subsequence.
Question Video
Constraints
1 <= length of strings S1 and S2 <= 1000
Sample Input
sea
aessa
Sample Output
2


  • Asked in Companies
  • Related Topics






Video Solution

Code Solution

Run
 
Run
Id Name