Driver Code
public static void main ( String [ ] args ) { String str = "101010" ; int Q [ ] [ ] = { { 0 , 1 } , { 2 , 5 } , { 2 , 3 } , { 1 , 4 } , { 0 , 5 } } ; int M = Q . length ; System . out . print ( toggleQuery ( str . toCharArray ( ) , Q , M ) ) ; } }