Java Program to count the minimum number of circular rotations required to obtain a given numeric Strings avoiding a set of blocked Strings
import java . util . ArrayList ; import java . util . Arrays ; import java . util . HashSet ; import java . util . LinkedList ; import java . util . Queue ; class GFG { static int minCircularRotations ( String target , ArrayList < String > blocked , int N ) { String start = " " ; for ( int i = 0 ; i < N ; i ++ ) { start += '0' ; } HashSet < String > avoid = new HashSet < > ( ) ; for ( int i = 0 ; i < blocked . size ( ) ; i ++ ) avoid . add ( blocked . get ( i ) ) ;