function that will check if the substring "IITA" can be found in the given line.The program have to use pointer. Output: YES/NO | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

function that will check if the substring "IITA" can be found in the given line.The program have to use pointer. Output: YES/NO

Please, help. I need a code

25th Oct 2020, 7:44 PM
Mizuki
4 Answers
+ 2
Since finding the substring "IITA" in another string is a specific case of finding any substring within another string, you can draw inspiration from C's strstr() function which does exactly that. This site lists possible implementations of the function: https://www.techiedelight.com/implement-strstr-function-c-iterative-recursive/ You can also check out this implementation by another user: https://code.sololearn.com/c5xUM50AQJUZ/?ref=app
25th Oct 2020, 8:26 PM
Shadow
Shadow - avatar
0
Write a function that will check if the substring "IITA" can be found in the given line. Note. The program have to use pointer. Input: First line contains one line that is not longer than 1000. Output: YES or NO.
25th Oct 2020, 7:48 PM
Mizuki
0
Thank you a lot!
25th Oct 2020, 8:32 PM
Mizuki
0
Use Hashing which will give you linear time complexity!
26th Oct 2020, 4:52 AM
Soheil
Soheil - avatar