Question: Is it possible to reverse an array without affecting the special characters ? By special characters, I mean anything characters not included from 'a' to 'z' and 'A' to 'Z'. I am short of ideas to build the algorithm, I still haven't it figured out.

Answer: 
Here's a solution that will do it "in place" in one pass.

```
bool isspecial(char c)
{
    if ((c >= 'a') && (c <= 'z')) return false;
    if ((c >= 'A') && (c <= 'Z')) return false;
    return true;
}

void rev(char* array, int N)
{
    int i = 0;     // i points to the first index of the array 
    int j = N - 1; // j points to the last index of the array

    while (i < j)
    {
        if (isspecial(array[i]))
        {
            i++;
        }
        else if (isspecial(array[j]))
        {
            j--;
        }
        else
        {
            char tmp = array[i];
            array[i] = array[j];
            array[j] = tmp;
            i++;
            j--;
        }
    }
}

```
```
        Console.WriteLine("enter any string");
        string str = Console.ReadLine();
        string[] revstr = new string[str.Length];
        for (int i = 0; i < str.Length; i++)
        {
            int ch = Convert.ToInt16(str.ToLower()[i]);
            if ((ch < 97 || ch > 122))
            {
                revstr[i] = str[i].ToString();
            }
        }
        for (int k = str.Length - 1; k >= 0; k--)
        {
            int ch = Convert.ToInt16(str.ToLower()[k]);
            if (!(ch < 97 || ch > 122))

            {
                for (int j = 0; j < str.Length; j++)
                {
                    if (revstr[j] == null)
                    {
                        revstr[j] = str[k].ToString();
                        break;
                    }
                }
            }
        }
        for (int s = 0; s < revstr.Length; s++)
        {
            Console.Write(revstr[s]);
        }

```