chef and chain wrong answer

though it is running successfully when i have run on other environment when submitted giving status wa

Passing the given test case doesn’t guarantee that your code is correct !

Try brainstorming your own test cases that might be more difficult to pass. Solve them on your own and see if your program is able to get it right

is-+± a chain??

No. only -±+ or ±± in this case.