Divide the array into two parts such that first part is increasing
Answers
Answered by
1
Split the array elements into strictly increasing and decreasing sequence
Given an array of N elements. The task is to split the elements into two arrays say a1[] and a2[] such that one contains strictly increasing elements and the other contains strictly decreasing elements and a1.size() + a2.size() = a.size(). If it is not possible to do so, print -1 or else print both the arrays.
Note: There can be multiple answers and the order of elements needs not to be
PLEASE MAKE ME AS A BRAINLIST ANSWER
Similar questions
English,
5 months ago
Science,
5 months ago
English,
5 months ago
Computer Science,
10 months ago
Science,
10 months ago
Social Sciences,
1 year ago