Question d’entretien chez Flipkart

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