Java: Count ways to increase LCS length of two Strings by one

Level : Intermediate
Mentor: Shailendra Chauhan
Type : GuidedLab
Points : 10
Duration : 00:25:00

Lab Details

Difficulty Level: MEDIUM

Problem Statement:

You are given two strings of lower alphabet characters, you need to find the number of ways to insert a character in the first string such that length of the Longest Common Subsequence (LCS) of both strings increases by one.


str1 = "efgefg"

str2 = "efgh"



Self-paced Membership
  • 22+ Video Courses
  • 800+ Hands-On Labs
  • 400+ Quick Notes
  • 55+ Skill Tests
  • 45+ Interview Q&A Courses
  • 10+ Real-world Projects
  • Career Coaching Sessions
  • Email Support
Upto 60% OFF
Know More
Still have some questions? Let's discuss.
Accept cookies & close this