Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

in a new game called the golden game, players collect gold coins. the players get only one chance to play and only one player play at a time. the score of each player is difines as the number of coins collected by the player. a player is called a golden player if he scores more than the players who played after her. score is called golden score if it is scored by a golden player. if your are given a list of (A) of integers representing scores of players in the order they played first to last. Write a program to print all the golden scores in the list by maintaining the relative order.

SAMPLE INPUT1:4 5 1 3 2

SAMPLE OUTPUT:- 5 3 2

SAMPLE INPUT2:9 8 10 12

SAMPLE OUTPUT2:12


you are given an N*N matrix. Write a program to check if the matrix is unique or not. A unique matrix is a matrix if every row and column of the matrix contains all the integers from 1 to N.

INPUT:

4

1 2 3 4

2 3 4 1

3 4 1 2

4 1 2 3

OUTPUT- True.

INPUT:

4

1 2 3 3

2 3 4 1

3 4 1 2

4 1 2 3

OUTPUT- False


in a new game called the golden game, players collect gold coins. the players get only one chance to play and only one player play at a time. the score of each player is difines as the number of coins collected by the player. a player is called a golden player if he scores more than the players who played after her. score is called golden score if it is scored by a golden player. if your are given a list of (A) of integers representing scores of players in the order they played first to last. Write a program to print all the golden scores in the list by maintaining the relative order.

INPUT- 4 5 1 3 2

OUTPUT- 5 3 2

INPUT- 9 8 10 12

OUTPUT- 12.


jeff ordered several items from an online shop. After recieving the order he found that some were faulty. So he wants to seperatethe faulty items from the rest. You are given that prices of the item Jeff ordered, where a negative sign indicates a faulty item. Write a program to shift prices of all the faulty items to the left without changing the relatie order of the input.

INPUT- 11 -12 13 -14 15 16

OUTPUT- -12 -14 11 13 15 16

INPUT- 21 11 -3 -2 9

OUTPUT- -3 -2 21 11 9


Jatin is a college student and he got his first salary from an internship. his plan is to buy one stock on a particular day and then sell it on another day. He can trade (buy & sell) the stock only once. he has one time use magic spell which he used to get the stock prices N future consecutive days. based on this information and his strategy determine the maximum profit he can make. in the given list of price, the price of stock on the ith day is denoted by prices[i]. If there is no profit that can be achieved , return 0.

INPUT -7 1 5 3 6 4

OUTPUT- 5

INPUT- 1 11 13 21 19

OUTPUT- 20


murli is attending a quiz the question contains an integer n murli gas to tell the closest number to n where all the digits of that number are even in case of a tie between two numbers choose the smallest one. write a program to find the number in python coding


Ram is given a positive integer N .He wishes to convert this integer into a single numeral. He does so by repeatedly adding the numerals of the number until there is only a single numeral. Help Ram by providing the single-numeral number finally obtained.


Write a program to generate 100 random numbers between the range 1 and 1000 and search for a number through user input.


Half Interval search: is a search algorithm that finds the position of an element to be searched within a sorted array(ascendiing ordrer).It compares the search element to the midlle element of the array.If they are not equal, the half in which the search element cannot lie is eliminated and the search continues the remaning half, again taking the middle element to compare to the target value is found. If the search ends with the element is not in the array.Write a function search(ele,*args) which takes a variable number of parameters, first is an element that needs to search among the input element list and second is a list of input elements. If the element is found ,then this function returns the position of the element otherwise returns- 1.


let x and y be the numbers obtained by reversing a and b, if both x and y are prime,then the answer is x+y and if exactly one of x and y is prime, then the answer is a+b.Otherwise ,the answer is a*b.Your task is write a function F(a,b) that takes integers a and b and returns a single digit integer value.Create seperate check_prime(n) and reverse(n) for checking a given number is prime and for reversing number.function must be generalized. Use only loops,if-else or if-elif-else and sting slicing,indexing as well simple inbuilt functions.