Death Killer
struct node{
int64_t s;
bool v1,v2;
vector<int> e;
node(int x) : v1(0),v2(0), s(x) {}
};
what does last line do
Kushal
Check the array is Sorted or Not ?
If Sorted so in which order
Ascending or descending?
I/P:- 1,1,1,1,2,3,4,4,5,6,7
O/P:- Ascending order Sorted
I/P:- 9,9,8,7,6,5,5,5,5,4,3
O/P :- Descending order Sorted
I/P:- 1,1,2,3,3,4,3,3,4,5,6,7
O/P :- Not Sorted
I/P :- 9,9,9,8,7,6,5,5,6,4,3,2,1
O/P:- Not Sorted
Time Complexity :- O(n)
Note :- if you sort the input then match, sort function time Complexity is O(nlogn)
Expected time Complexity is O(n)