Help rahul to search

https://ide.codingblocks.com/#/s/15694
Sir in this question in one testcase is run time error is coming in hackerblocks.

Hey Nitesh ,
You are getting runtime error because you are fixing the size of the input array as 100 and the input coming has number of elements greater than 100.
Rectify it then you will not get the runtime error .

rectify it is also not solving i have change the array size to 10000;even then wrong answer in second test case is coming my output is coming right for sample test case

You have some issue in your logic also just go through it once again if still you cant rectify your wrong answer then reply here i will share you the problem with your code

https://ide.codingblocks.com/#/s/15713
the size is not sufficeint as linear searched is not allowed so size is very big

https://ide.codingblocks.com/#/s/15714
i have modified ur code beside size u have done a silly mistake ,just figure it out

how i wiil able to know when to use long long int.In question there is no such constraint of n is given

if nothing is given then use it ,might be the number in test case not in integer range so its better to use long

1 Like

but in this code it is saying that key is not declared inthis scope