What is the problem in the code

no element in the dp array is getting updated

Hey @Parmeet-Kalsi-1631789033630118
Problem is in line 14
Replace it by :

if (s1[i] == s2[j]&& s2[j] == s3[k]) {//updated this

If this resolves ur query then please mark it so :slight_smile:

still not working

Bro for current input, all will stay 0

try
a
a
a
or
a
ab
abc

ohh :sweat_smile:
thaks a lot

1 Like