A note on two-dimensional cyclic and constacyclic codes