Increase the visit count of the left and right cells within the array which can be visited
for ( $ j = max ( 0 , $ i - $ str [ $ i ] ) ; $ j <= min ( $ len , $ i + $ str [ $ i ] ) ; $ j ++ ) $ visited [ $ j ] ++ ; } for ( $ i = 0 ; $ i < $ len ; $ i ++ ) {