hey the logic seems fine and its running locally but while submitting getting run error
Getting run error
@pradyumn25jain it seems right
try removing the template and using int and declaring temp size as 1000005
if it still give run time send the updated code
|Ai|<=10^9 since we have a constraint we will need long long int
but with long long i am not getting any output
something was wrong on the server side i guess i refreshed and tried again , it was successfully submitted
thanks