Emma wants to gift a bouquet to her father on his birthday and asked for help from her mother Rosy. Rosy gives N flower sticks numbered 1 to N to Emma and tells her to arrange them in the bouquet in a particular order. She asks her to arrange the first K flower sticks in the order of their increasing length and the remaining sticks in the order of their decreasing length.
Write an algorithm to find the final arrangement of the flower sticks in which Emma gifted the bouquet to her father.
Input:
The input to the function/method consists of three arguments.
Output:
Return a list of integers representing the final pattern of the flower sticks in which Emma gifted the bouquet to her father
Constraints:
Random < num
0 < num < 106
The logic is to print the elements in a sorted way up to kth value. Then print the remaining elements in reverse order.
For Example:
Asked in recruitment drive of Wipro.n
@@coding::1@@