thos is the code https://ide.codingblocks.com/s/347317
Please remove the syntax errors only
here
code is not showing desired output
here
this prints your output
you still need to debug the code for case like
Input:
1 2 3 1 2 3 1 2 3 1 2 3 -1
Expected Output:
1 2 3
Your Output:
1
here is the corrected code