Do we need to validate the inputs given by the tests?
No, but you’ve to take care of the constraints!!
No, Input will always be in range of given ranges mentioned in constraints section, UNTIL UNLESS IT’s MENTIONED SPECIFICALLY IN QUESTION TO CHECK IT. You will have to implement a solution that will execute and give correct answer in given Time Limit for constraints mentioned in question.