C SOLUTION
C\nchar* baseNeg2(int N) {\n    int a = N;\n    if(a==0){\n        return "0";\n    }\n    int num = 0;\n    char* result = (char*)malloc(sizeof(char));\n    re
```C\nchar* baseNeg2(int N) {\n    int a = N;\n    if(a==0){\n        return "0";\n    }\n    int num = 0;\n    char* result = (char*)malloc(sizeof(char));\n    result[0] = \'\\0\';\n    while(a!=0){\n        int tmp = a/(-2);\n        int k = a%(-2);\n        num++;\n        if(k<0){\n            k = 2+k;\n            tmp++;\n        }\n        result = (char*)realloc(result,(num+1)*sizeof(char));\n      \n        result[num] = \'0\'+k;\n        a = tmp;\n    }\n    int i;\n    char* result2 = (char*)malloc((num+1)*sizeof(char));\n    for(i = 0;i<num+1;i++){\n        result2[i] = result[num-i];\n    }\n    return  result2;\n}\n```
[]