Does anyone know how to write coding for this problem using c or java | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Does anyone know how to write coding for this problem using c or java

Input: S1="every morning I want to do exercise regularly" S2="every morning I want to do meditation without fail" S3="it is important I want to be happy always" Output: I want to

22nd Jun 2021, 9:38 AM
Sathish Kumar M
Sathish Kumar M - avatar
2 Respuestas
+ 3
Sathish , i think this kind of task is called: find a "common consecutive substring" in a number of n strings.
22nd Jun 2021, 2:02 PM
Lothar
Lothar - avatar
0
From s1 take every word, and check is it in s2 and s3 if yes print else do nothing.. Java has a method String.contains("string literal"); which does this job.. In C, also has, strtok() method to split string and also strsub() method to extract substring.. also check string.h library which may help you more to do that easy..
22nd Jun 2021, 12:26 PM
Jayakrishna 🇮🇳