'Is there a way to enforce an array size declaration based on another array size when declaring types?

I need to define an interface for function parameters. Consider we have two parameters, both of type array and one is dependent on the other in terms of another one's length and containing elements' type(Elements are of the same type).

Is there a way to declare one of them as lengthy as another one?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source