C ++ Program to count the minimum number of circular rotations required to obtain a given numeric strings avoiding a set of blocked strings
#include <bits/stdc++.h> NEW_LINE using namespace std ; int minCircularRotations ( string target , vector < string > & blocked , int N ) { string start = " " ; for ( int i = 0 ; i < N ; i ++ ) { start += '0' ; } unordered_set < string > avoid ; for ( int i = 0 ; i < blocked . size ( ) ; i ++ ) avoid . insert ( blocked [ i ] ) ;