Grokking Dynamic Programming Patterns for Coding Interviews
Ask Author
Back to course home

0% completed

Vote For New Content
Input: “f m f f” should result 1, right?

Junaid Effendi

Aug 18, 2022

Input: “f m f f” should result 1, right?

0

0

Comments
Comments
J
Junaid Effendi3 years ago

Its shared , means both of the two subsequence have same index f, so it should not be counted twice?

Design Gurus
Design Gurus3 years ago

It is shared, but that is fine. As the problem states:

none of the corresponding characters in the repeating subsequences have the same index.

This means, index of the corresponding character should not be same.

ffmf, has to subsequences: FF => FmFf and fmFF.

SEC...

On this page