Tap here to switch tabs
Problem
Submissions

Problem: Longest Uncommon Subsequence I

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

Statement

Given two strings a and b, return the length of the longest uncommon subsequence between them. If no uncommon subsequence exists, return −1-1.

An uncommon subsequence between two strings is defined as a string that is a subsequence of one string but not a subsequence of the other.

Note: A subsequence of a string is a new string generated from the original string by deleting zero or more characters without changing the relative order of the remaining characters.

Constraints:

  • 1≤1 \leq a.length, b.length ≤100\leq 100

  • a and b consist of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Longest Uncommon Subsequence I

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

Statement

Given two strings a and b, return the length of the longest uncommon subsequence between them. If no uncommon subsequence exists, return −1-1.

An uncommon subsequence between two strings is defined as a string that is a subsequence of one string but not a subsequence of the other.

Note: A subsequence of a string is a new string generated from the original string by deleting zero or more characters without changing the relative order of the remaining characters.

Constraints:

  • 1≤1 \leq a.length, b.length ≤100\leq 100

  • a and b consist of lowercase English letters.