Function to convert binary number to its equivalent decimal value
static int convertBinaryToDecimal ( List < int > arr ) { int ans = 0 ; foreach ( int i in arr ) ans = ( ans << 1 ) | i ; return ans ; }