Scaling (set of stairs) between two edges
If I got what you asked, try this:

get the desired length selecting the mesh delimiting the available space (in the image it seems a sort of cubic shape), and copy the Y dimension in the properties panel.



Then select your stair made of array-copied steps, and in the same panel it should have a different value:



now paste the copied value in the Y dimension.



it should fit perfectly