Why visited array is taken dunamic not static?

I checked editorial for this problem and i saw they have created visited array as dynamic. I don’t understand why?
Please tell me when to take dynamic array??

@mb129162 it is always best to use a dynamic array when size of array is not known beforehand. You can also use vectors instead, because they offer the same functionality of dynamic arrays but they can also be resized and have a number of other STL functions as well.

But in this problem we actually know the size of aray that has max sizen of 17

@mb129162 max size and knowing exact size is not the same thing. You will still be wasting some amount of space so it is best practice to avoid it wherever possible. Its not such a big deal anyway, you can use whatever kind of array you want.