7. Write a function in C or Java that accepts integer n as an input and returns the following result.
(15%)
1 1 1 1
1 1 2 1 2 3 1 2 3 n