In reply to dave_59:
Hello Dave !
When I said pattern meaning, based on the size of array I wanted to set certain elements of the array with particular value.
1. If size of array is 1, the value of the single element should be 1.
2. If the size is 3, then the 3 array element value should be 9,7,7.
3. If the size is 7, then the first element shouldn't be 0 or 9 or the first 3 elements of the 7 element array should be 9,7,7.
4. And if the size of the array is 11, then the first element should always be 1.
So would like to know how to effectively set partial array elements with specific values. Is the above approach seems fine, or is there a way I can use some reduction operators.