Domanda di colloquio di Flipkart

Find Number of Monotonestically Increasing or Decreasing subsequences in the given array.