Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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
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.
This comment is hidden because it contains spoiler information about the solution
Thank you.