Longest Anagram Subsequence
Given two lowercase alphabet strings a and b, return the length of the longest anagram subsequence.
Constraints
n ≤ 100,000wherenis the length ofam ≤ 100,000wheremis the length ofb
https://binarysearch.com/problems/Longest-Anagram-Subsequence
Examples
Example 1
Input
- a =
afbc - b =
cxba
Output
- answer =
3
Explanation
- “abc” is a subsequence in “afbc”
- “cba” is a subsequence in “cxba”
And abc and cba are anagrams of each other.
Leave a comment