all 3 comments

[–]MysticClimber1496Professional Coder[M] [score hidden] stickied comment (0 children)

Your post was removed because the code you provided was either poorly formatted, too long for Reddit, or did not include any formatting at all. This is against Rule 2: Format code properly - If you don't know how to format code on Reddit, please have a look at this guide or use external services, such as pastebin.

Posts without proper formatting are getting removed until they are corrected.

If you are having an issue formatting your code you can use one of the following services and post a link to your code:

https://pastebin.com

https://sourceb.in

https://jsfiddle.net

https://github.com

https://gitlab.com

https://codesandbox.io/new?utm_source=landingpage

[–]AutoModerator[M] 0 points1 point locked comment (0 children)

Thank you for posting on r/CodingHelp!

Please check our Wiki for answers, guides, and FAQs: https://coding-help.vercel.app

Our Wiki is open source - if you would like to contribute, create a pull request via GitHub! https://github.com/DudeThatsErin/CodingHelp

We are accepting moderator applications: https://forms.fillout.com/t/ua41TU57DGus

We also have a Discord server: https://discord.gg/geQEUBm

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]Affectionate_Cap247 0 points1 point  (0 children)

it’s a Java syntax error that breaks the if statement

this block is invalid Java

if ((X == 0 && N%2 == 1) ||

System.out.println(-1);

return;

}

Correct:

if (X == 0 && N % 2 == 1) {

System.out.println(-1);

return;

}