← All problemsSign in

sequence

Given two strings, A and B, find and print the total number of ways to insert a character at any position in string A such that the length of the Longest Common Subsequence of characters in the two strings increases by one. Input Format The first line contains a single string denoting A. The second line contains a single string denoting B. Constraints Scoring 1Output Format Print a single int

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start