Imagine this, imagine that you are the best programmer. You know that you know a lot of algorithms, and don’t think to think twice when implementing them. You know how to change an already known algorithm to suit the needs of the problem. You are strong with estimating time and complexity, and you expect that in the worst case scenario, your adapted algorithm will work in time and memory constraints.
At this level, you just think and use the notebook for about five to ten minutes, and before you start coding, you will get a super-clean algorithm. When you finish coding, you will get to compilation and, as a rule, there is no compilation error. Because the code is so intuitive to you. Then, based on the algorithm used and the data structures used, you expect that there may be one of the following problems.
- corner case
- overflow problem
The angular case is basically similar to what you encoded for the general case, however, when they say N = 1, the answer is different. Therefore, you usually write it as a special case. Overflow occurs when intermediate values or results overflow data type restrictions.
You note any problems that are currently occurring, and use this data during the call phase (as in TopCoder).
Once you have verified these two, click on "Submit."
Aravind
source share