Ad
  • Custom User Avatar

    else if (bitIndex > binValueList.Count)
    {
    result.Append(binValue.Insert(0, "1"));
    }
    in this line you add one bit in the beginning of result, But tests can be like this: FlipBit(127,17).In that case you should flip 17th bit of 8bit number, but in your code you flip 9th bit

  • Custom User Avatar

    forum is not dead!)
    on that line -> if (binValueList != null && bitIndex <= binValueList.Count) you check for bitIndex <= binValuelist.Count,
    but test cases can be like this : FlipBit(1,2) and bitIndex can be > than binValuelist.Count,
    so your result become empty and in that line -> int testBin = Convert.ToInt32(result.ToString(), 2); you have error.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar