a swap define take distinct position array swap value themA circular array define array consider element element adjacentGiven binary circular array num return minimum number swap require group 1s present array location Example 1input num 0101100output 1explanation here way group 1s together0011100 1 swap0111000 1 swap1100001 2 swap circular property arraythere way group 1s 0 swapsThus minimum number swap require 1example 2input num 011100110output 2explanation here way group 1s together111000011 2 swap circular property array111110000 2 swapsthere way group 1 0 1 swapsthu minimum number swap require 2example 3input num 11001output 0explanation all 1s group circular property arraythus minimum number swap require 0 Constraints1 numslength 105numsi 0 1