Maximum length Biotonic Subarray

help with this problem

Hello @Himanshu-Sajwan-2271264282963988,

  1. What is a Biotonic Array?
    A subarray A[i … j] is biotonic if there is a k with i <= k <= j such that A[i] <= A[i + 1] … <= A[k] >= A[k + 1] >= … A[j – 1] > = A[j] i.e
  2. subarray is first increasing and then decreasing or
  3. entirely increasing or
  4. entirely decreasing.

So, you have to check for length of all possible biotonic subarrays and then print the maximum length.
Try to write code and share it with me if you would be stuck.

Hope, this would help.
Give a like, if you are satisfied.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.