def getMin(arr, n):
          # If there is only one element then return it as min
          if n == 1:
              min = arr[0]
              return min
          # If there are more than one elements, then initialize min
          min = arr[0]
          for i in range(1, n):
              if arr[i] < min:
                  min = arr[i]
          return min
      # Driver Code
      if __name__ == "__main__":
          arr = [10, 11, 45, 89, 33, 30]
          arr_size = 6
          min = getMin(arr, arr_size)
          print("Minimum element is", min)
      
      Python language logo

      Minimum Element

      Find minimum elements from a list of elements

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.