Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren0
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
4 Antworten
+ 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
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.
0
Thank you a lot!
0
Use Hashing which will give you linear time complexity!