Min query-1 time complexity

what will be the total time complexity for this ques

  1. segment tree
  2. brute force
    3)other method plz do mention it