Getting half test cases failed please help
Array Manipulation Problem
can you please tell me what is wrong with my code
okay give meh 10 min
but please tell me what code i need to past in the hackerrank editor
or i paste the entire code u shared ??
entire code you can paste
since the queries are 1 indexed based so take array to be n+1 size
but even then
u score 24
since constraints are large
and the time complexity is high
that is why It is HARD question u need to reduce the complexity of the program
u can watch out my code for the optimised method/algo
Okay thanks got it 
one thing please tell me every time I apply brute force but I didn’t got logic for optimised code.
How can I get logic of optimised code
see this can only be achieved with a lot of practice
first of all go through all standard questions ( ones disccussed in the course)
there the most optimised methods are discussed
search those question on gfg
start reading from brute approach
then the gfg articles moves to more optimised approach
so u`ll thought process will change
gradually
then start practising leetcode
read the discussion panel there are pro programming write the solutions for u even if u do the question by your self give a moments time to read their solution … learning will help u to move to more optimised solutions

