String Subsequences

String Subsequences is a Morganstanley interviews coding interview problem. Given two uppercase strings, with s1 length 3 and s2 up to 5e5, determine how many times s1 appears as a subsequence in s2 (order preserved, characters may be skipped). This interview question asks you to return the count as an int in a typical coding interview setting.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: