Longest Anagram Subsequence
Given two lowercase alphabet strings a
and b
, return the length of the longest anagram subsequence.
Constraints
n ≤ 100,000
wheren
is the length ofa
m ≤ 100,000
wherem
is 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