As a beginner , intermediate or experienced coder , it’s quite natural to have doubts regarding a question , problem statement , test cases or approach so I thought I’d come up with a few guidelines , by no means are these hard and fast rules , just my opinion :
- Make sure that the problem is not from an ongoing contest !
- If you plan to include code in your question , please format the code like @ssjgz always reminds us that the forum software has mangled the code;) . It really isn’t that hard : Three backticks (```) before code and three after the code should do the trick
#include <bits/stdc++.h>
using namespace std ;
int main()
{
//Pretty colors and formatted code , here we come
return 0 ;
}
- Try to use meaningful variable names and clean code . Nobody is going to benefit from obfuscated code , I’ve read codes where variables were named after ahem cuss words and while you’re free to name it (whatever suits your fancy) , while asking for help , it’s better if understandable
- Provide Context -
i. Link to the problem statement , it makes it easier for people to read and understand the problem , get initial bearings , understand the sample input and you’ll get help faster
ii. Provide a brief write-up demonstrating what you’ve tried so far and what exactly you need help with , makes it so much better than a generic “Help Me! Fast” - Check if an Editorial exists , if it does and you’re stuck , read it and try to understand it , maybe read the hints and give the problem a try again , maybe you’ll solve this and the green tick will be yours
. Google or check the forum if your question has already been answered!
(TB to every time a post was made asking why the fully solved problem appeared as partially solved) - There’s a nice policy on Quora , Be Nice Be Respectful (BNBR) , I think it applies here too and I hold the opinion that both the OP and the persons who respond have to be respectful to one another , ill-language and trashing someone does not help and has quite the opposite effect.
- There are many posts stating that the test cases are wrong , mostly by people starting out , the chance of that in an official contest is I’d say very low . Something like getting heads five times in a row on tossing an unbiased coin. Possible , yes but rare . The problem might unfortunately be with your logic :((
- If you are getting a wrong answer , check the constraints , identify the corner cases where you think your program / logic might fail and try again . In case of a TLE , try to come up with a solution with better complexity , if you have Seg Fault , check for array out of bounds etc.
- There isn’t a certainty that someone with a rating higher than you always has the right answer to your solution , read all the answers and find out what best suits your needs and maybe say a thank you if possible ? Small tokens of appreciation go a long way .
- I don’t mind tagging people (once), I’ve seen a lot of people tagging @vijju123 , @ssjgz , @tmwilliamlin , @everule1 etc. (and others who are on the top contributors list?) which is understandable as they do help the most people , but don’t force people , you have to wait , be patient , it likely will take some time before your query is resolved and tagging people repeatedly with imperative statements gets annoying
People who willingly take up a moment of their time to answer your question diligently in the best possible way !
Let me know if you agree or disagree with these or if you have some more you’d like me to add
Stay Safe!
Happy Coding!