Https://ide.codingblocks.com/s/264959

int this where i am doing wrong as i am not able to create two pointers ??
and i have also one doubt why my leaderboard score is zero but i have done the course till dynamic memory allocation

@architsuryavanshi

  1. you are taking the input wrong. Arrays start from index 0, and will go till index n-1. You are taking input from 1 to n.
  2. Your for loop is initialised with left and goes till right, but both of these values have not been defined. They will hold garbage value initially.
  3. You are taking sum of indices. You have to take sum of the VALUES at those indices and compare that to target.
  4. And please rember the indices part carefully as you have made that mistake all over the code. Arrays are 0-index based, not 1-index based.

Your leaderboard score depends on the number of problems you’ve solved, not the course percentage.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.