category-wise-problems

contains category wise problems(data structures, competitive) of popular platforms.

View the Project on GitHub mayankdutta/category-wise-problems

Divide and print

implementation ```cpp string isFlexible(int n, vector arr) { int i = 1; while (i < n and arr[i - 1] < arr[i]) i++; int stop_one = i; while (i < n and arr[i - 1] == arr[i]) i++; int stop_two = i; if (stop_one == stop_two) return "NO"; if (stop_two == n) return "YES"; while (i < n and arr[i - 1] > arr[i]) i++; return (i == n ? "YES" : "NO"); } ``` </details>