Pattern challenges (simple input)

in this challenge we have been given input constraint i.e -1000 to 1000
but i ignored that still my code was succesful so what is its use i didn’t understand cause i have seen such constraints in codechef also . do i have to put some conditions on the input i am taking?

@deepanshu_123,
Constraints are given to you to give you an idea of the range of input that will be used.
Like if it meant numbers between -10^12 to 10^12, then you need to use long instead of int.

And you can get an idea of the max time complexity of your code from the constraints given. if the number of inputs are 10^7 then you can use a maximum of O(n) complexity because more than that will give you a TLE.

Ok but What is O(n) complexity pl explain

@deepanshu_123,
O ( n ) is Big O Notation and refers to the complexity of a given algorithm. n refers to the size of the input, in your case it’s the number of items in your list. O ( n ) means that your algorithm will take on the order of n operations to process an item.

You can watch the Time and Space Complexity section to get a better idea about them too.