unique path use one dimension array or two dimension array