Not able to pass test case

mycode

hi @chirag.goel360
try changing this condition like this
image
find() returns string::npos if a substring is not found.

still not passing test cases

@chirag.goel360 since you are using a character array, it is also important to add a null character in out manually, when you are done adding characters to the string.
Please try submitting this code and let me know if it still does not pass https://ide.codingblocks.com/s/269301
Your logic is completely correct, so if it still does not pass i’d suggest you to use “string” datatype instead of a character array.