Number of unique substrings of particular length of a binary string
Your code can be more efficient.  For example, both nested for-loops can be replaced with single for-loops.  In the first loop, the next sum can be calculated by left-shifting the previous sum, adding the new bit, and masking off n-bits.  count[sum] is how many times an n-bit pattern == sum has been seen.  So the second loop merely counts how many '1's are in count.  Something like the code below (not tested).

int count_unique(char *arr, int n) {
    int mask = (1 &lt;&lt; n) - 1;

    /* the size needs to be 2**n.  This works for n &lt;= 10 */
    int count[1024];
    memset(count, 0, sizeof(count));

    int sum = 0;

    for (int i = 0; arr[i]; i++) {
        sum = ((sum &lt;&lt; 1) | (arr[i] - '0')) &amp; mask;

        if (i &gt;= n - 1) {
            count[sum]++;
        }
    }

    int unique = 0;

    for (int i = 0; i &lt; sizeof(count)/sizeof(int); i++) {
        if (count[i] == 1) {
           unique++;
        }
    }

    return unique;
}