All my solutions in the code editor suddenly went missing. How can I retrieve my solutions?
The code you typed into the code editor is stored temporarily in your browser session, however all your submitted solutions were stored permanently.
Fear not, just click on the "code" icon to retrieve your last submitted code.
Where to find all my submitted code?
Go to the submissions page, then click on the status of that submission row to view more details such as your submitted code.
What are the environments for the programming languages of OJ?
For hash table operations, you may use uthash.
|C#||mono 4.2.1||Run with
underscore.js library is included by default.
I encountered Wrong Answer/Runtime Error for a specific test case. When I test my code using this test case, it produced the correct output as shown below. Why?
First, please check if you are using any global or static variables. They are Evil, period. If you must declare one, reset them in the first line of your called method or in the default constructor. Why? Because the judger executes all test cases using the same program instance, global/static variables affect the program state from one test case to another. See this Discuss thread for more details.
Are you using C or C++? If the answer is yes, chances are your code has bugs in it which cause one of the earlier test cases to trigger an undefined behavior. See this Discuss thread for an example of undefined behavior. These bugs could be hard to debug, so good luck. Or just give up on C/C++ entirely and code in a more predictable language, like Java. Just kidding.
Am I allowed to print something to stdout?
Yes. You may print to stdout for debug purposes and it will not affect the judgment of your solution. However, doing so will most likely increase the runtime of your program and you may get Time Limit Exceeded or Output Limit Exceeded due to too much extraneous output.
[1,null,2,3]mean in binary tree representation?
[1,null,2,3] represents the serialized format of a binary tree using level order traversal, where
null signifies a path terminator where no node exists below. StefanPochmann made an interesting tree visualizer tool. Check out some examples below.
Empty tree. The root is a reference to
1 / \ 2 3
1 \ 2 / 3
5 / \ 4 7 / / 3 2 / / -1 9
What is the difference between 'Time Limit Exceeded' and 'Timeout'?
If your solution is judged 'Time Limit Exceeded', it could be:
On the other hand, 'Timeout' simply means the server queue is busy and could not process your submission for the time being. Please wait for about 10 seconds and submit again.
I messed up in the code editor and would like to start from scratch on a particular problem. How do I reset to the default code definition?
Just click on the reset button to reset your code.
I need to start another round of coding practice. Is there a way to reset the checkmarks of all solved problems?
Yes. Just go to the Session Management panel and activate a new session. Your previous session will be saved and you will start fresh. Your progress will now be tracked separately in the newly created session.
Your blog used to have great explanation of the questions and solutions. I am unable to find it anymore. Did you remove them? Is the blog archived somewhere? Can we have access that? Is it possible to bring it back?
No, it is not removed. All articles were migrated to http://articles.leetcode.com. All old links will automatically be redirected to articles.leetcode.com, for example: http://leetcode.com/2011/11/longest-palindromic-substring-part-ii.html