private static void firstDotConstellation ( int [ ] dollarPositions , int [ ] dotPositions , int nestingLevel ) { int i = 0 ; int unassigned = dotPositions . length - nestingLevel ; for ( ; i < unassigned ; ++ i ) { dotPositions [ i ] = - 1 ; } for ( ; i < dotPositions . length ; ++ i ) { dotPositions [ i ] = dollarPositions [ i ] ; } }
This will set the last nestingLevel elements in the dotPositions to the values present in the dollarPositions . The rest will be set to - 1 .