• + 1 comment

    Its always good to consider all the edge cases before providing any solution but when competitive programming come into picture then we should always consider the input first what i feel because type of input and size of input will create huge different. even it can change your complete algorithm.

    And when you know they you are not going to get that kind of input then it does not make sense to code for it . there is a principle called YAGNI.

    just have a look you will come to know, there is no place for dead code.