New answers tagged

-1

Hii here is my approach using C++. You can follow it along with the comments. int solution(vector<int> &A){ int count = 0; //First checking if we can cut zero or not if(A[1]-A[0] > 0 && A[2]-A[1] > 0){ count++; } if(A[1]-A[0] < 0 && A[2]-A[1] < 0){ count++; } //Checking if we can cut from first till last for(...


Top 50 recent answers are included