Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 5 months ago. Improve this question Suppose I have following array Expected output Wanted display questions data in a table format, which is not organised and has n number for options.
Tag: group
How do you group an array by n and the number of decreasing integers (n-1)? With the output to be the total number of arrays
For example, this is the input array: [2, 1, 4, 4, 3] From this array, n-1 patterns will be established from left to right. This output would be the number 7 because the following separate arrays exist after grouping: [2] [1] [4] [4] [3] – 1 group (n) [4, 3] – 1 group (n-1) [2, 1] – 1 group (n-1)