Dynamic memory arrays have a fixed size. What is the purpose of using a dynamic memory array vs. a fixed-size memory array? What makes them dynamic?
in solidity, fixed arrays are allocated in memory or storage at compile time, which makes them more efficient in terms of gas costs and faster to access than dynamic arrays. A dynamic array, however, can change in size during runtime. Dynamic arrays are allocated on the heap and require more gas costs to access and modify elements compared to fixed-size arrays.
One key advantage of dynamic arrays is their flexibility to adjust their size, which makes them suitable for storing large data where the size is not known in advance. However, this flexibility comes at the cost of higher gas costs and slower execution time.
So, fixed-size arrays are more efficient in terms of gas costs and faster to access, while dynamic-size arrays are more flexible but require more gas costs and are slower to access. The choice between them depends on your use case
Hope this helps