Tap here to switch tabs
Problem
Submissions

Problem: Longest Uncommon Subsequence II

med
30 min
Try to solve the Longest Uncommon Subsequence II problem.

Statement

Given an array of strings strs, return the length of the longest uncommon subsequence among them. If no uncommon subsequence exists, return −1-1.

An uncommon subsequence is defined as a string that is a subsequence of one string in strs but not a subsequence of any other string in strs.

A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.

Constraints:

  • 2≤2 \leq strs.length ≤50\leq 50

  • 1≤1 \leq strs[i].length ≤10\leq 10

  • strs[i] consists of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Longest Uncommon Subsequence II

med
30 min
Try to solve the Longest Uncommon Subsequence II problem.

Statement

Given an array of strings strs, return the length of the longest uncommon subsequence among them. If no uncommon subsequence exists, return −1-1.

An uncommon subsequence is defined as a string that is a subsequence of one string in strs but not a subsequence of any other string in strs.

A subsequence of a string is a new string generated from the original string with some characters (can be none) deleted without changing the relative order of the remaining characters.

Constraints:

  • 2≤2 \leq strs.length ≤50\leq 50

  • 1≤1 \leq strs[i].length ≤10\leq 10

  • strs[i] consists of lowercase English letters.