bugfree Icon
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course

Leetcode Problem 521. Longest Uncommon Subsequence I

521. Longest Uncommon Subsequence I

Leetcode Solutions

Simple Analysis Solution

  1. Check if strings a and b are identical.
    • If yes, return -1.
  2. Check if the lengths of a and b are equal.
    • If yes, return the length of a (or b).
  3. If the lengths of a and b are not equal, return the length of the longer string.
UML Thumbnail

Brute Force Approach

Ask Question

Programming Language
image/screenshot of info(optional)
Full Screen
Loading...

Suggested Answer

Answer
Full Screen
Copy Answer Code
Loading...