Although the statement has lots of exceptions like using my own library files for solving sorting etc. problems. So keeping all those cases aside lets debate on this question. On the first sight it looked as if it is easy(considering both the code length, and difficulty). But it turned out that after completing the coding on every instance I realized at the same time, of a corner case. And at the end, it resulted in 111 lines of code.(actually it’s 113, but I cut it down to 111 by removing a couple of preprocessor directives). I’m sure that we can code it better. After all it’s solved so I don’t want to keep my lazy ass on it.