Pergunta de entrevista da empresa Flipkart

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