← SAP questions

Longest subsequence which is a substring

Filed under SAP

Given two strings s1 and s2, find the length of the longest string that is a subsequence of s1 and also a contiguous substring of s2. A subsequence is formed by deleting zero or more characters from…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related SAP questions

Collected from public candidate posts and coding forums. Updated Nov 2026.