Question: Recently i came across a question during a programming contest on codeforces. Problem tags referred that the problems could be solved by using two pointer method. 
What exactly is the Two Pointer Method?

Answer: 
Google reports 2350 hits for "two pointer method" but the first couple pages use the phrase to refer to a variety of algorithms. It's seldom capitalized. Probably they were referring to one of several alternatives that had already been established in other discussion, literature, etc specific to the group hosting the competition.
I guess you are talking about something like this:

```
int **allocation(int n, int m) {
   int **matrix;
   int i;

   matrix = (int **) malloc(sizeof(int *) * n);
   for (i = 0; i < n; i++)
     matrix[i] = (int *) malloc(sizeof(int) * m);

   return matrix;
}

```