Coding | Mcqs | Multiple choice questions | Informative | Computer Science | Engineering | Aptitude | Quants | Verbal

INFEED

PreAssesment

Problem Statement: Your old mobile phone gets broken and so you want to purchase a new smartphone and decide to go through all the online websites to nd out which dealer has the best offer for a particular model. You document the prices of N dealers. Dealer ids start from 0 and go up to N. Find out which dealer has the best price for you. Constraints: 1 <= N <= 100 1 <= A[] <= 100000 Input Description: Number of dealers followed by the price offered by each dealer Output Description: Dealer offering the best price 

a=int(input())

z=list(map(int,input().split()))

k=z.index(min(z))

print("dealer",end="")

print(k)


Problem Statement: Given a number N, followed by an array of N elements,print 'yes' if it is a sorted array otherwise print 'no'. Constraints: 1 <= N <= 100000 Input Format: Enter size of array N , followed by N elements of the array. Output Format: Corresponding output.

a=int(input())

b=list(map(int,input().split()))

j=sorted(b)

if(b==j):

  print("yes")

else:

  print("no")

1 Comments

Post a Comment

Previous Post Next Post