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

Difficult Addition


Arjun is trying to add two numbers. Since he has learned addition recently, an addition which requires a carry is difficult for him. Your task is to print Easy if the addition does not involve a carry, Otherwise print Hard.


Input

The first line of input contains two space separated integers A and B.


Output

If the addition does not involve a carry,print Easy, otherwise print Hard.


Explanation

When calculating 229 + 390, we have a carry from the tens digit to the hundreds digit, so the answer is Hard.


Sample Input1

123456789 9876543218

Sample Output1

Easy


Sample Input2

229 390

Sample Output2

Hard



Write a program to compute the number of distinct shortest paths between two given vertices in an undirected graph with unit edge lengths. Your algorithm should run in linear time. Input Format: The input is a text file which describes the undirected graph G. The first line of the file specifies n, m, u and v, the number of vertices, the number of edges, and the two given vertices respectively. The next m lines specify the m edges of the graph, one line per edge. An edge is described by its end points (no edge weights are described since all the edges have unit length). If the number of vertices is n, assume that the vertices of the graph are numbered (0,1,..n-1). Output Format: Print the number of distinct shortest paths between vertices u and v. Sample Input (for the graph shown on the right): 6 10 5 0 0 1 0 2 1 2 1 3 1 4 2 3 2 4 3 4 3 5 4 5 Sample Output : 4


Given undirected weighted graph, write a program to find shortest paths from designated source vertex all other vertices graph using Dijkstra’s shortest path algorithm. Input Format: input is text file which describes undirected graph. first line file specifies n, m, s, number vertices, number of edges and source vertex respectively. next m lines specify m edges graph, one line per edge. edge is described by its end points followed by weight of that edge. If number of vertices is n, assume that vertices of graph are numbered (0,1,..n-1). Also assume that edge weights are non-negative. Output Format: Print shortest path from source vertex to each vertices in graph, along with length shortest path. Sample Input ( graph shown on right): 5 8 0 0 1 4 0 2 2 1 2 1 1 3 2 1 4 3 2 3 4 2 4 5 3 4 1 Sample Output : Shortest path to 0: 0 ; cost = 0 Shortest path to 1: 0, 2, 1; cost = 3 Shortest path to 2: 0, 2; cost = 2 Shortest path to 3: 0, 2, 1, 3; cost = 5 Shortest path to 4: 0, 2, 1, 4; cost = 6


Difficult Addition


Arjun is trying to add two numbers. Since he has learned addition recently, an addition which requires a carry is difficult for him. Your task is to print Easy if the addition does not involve a carry, Otherwise print Hard.


Input

The first line of input contains two space separated integers A and B.


Output

If the addition does not involve a carry,print Easy, otherwise print Hard.


Explanation

When calculating 229 + 390, we have a carry from the tens digit to the hundreds digit, so the answer is Hard.



Sample Input1

123456789 9876543218

Sample Output1

Easy


Sample Input2

229 390

Sample Output2

Hard


Lowest and Highest score

The teacher gave out the scores of the science quiz conducted last week and asked the ones with the lowest and highest scores to group up. Print the names of the students with minimum and maximum scores, respectively.

Note: In case of a tie, choose the name which comes first in the (dictionary order).


Sample Input1

2

shakti 24

disha 26

Sample Output1

shakti disha


Sample Input2

3

ajay 23

bijay 24

sanjay 23

Sample Output2

ajay bijay


Your friend sent you a message, however his keyboard is broken and types a # instead of a space.


Replace all of the # characters in the given input with spaces and output the result.


def indexing(arg_1, arg_2):

# Complete this function


word = input()

index = int(input())

# Call the indexing function


how to complete this code to get desired output by using above code


input:

chocolate

2


output:

o


input:

google

4

output:

l


Using the Fare Matrix above, create a Python program (using any of the selection structures) that will accept distance in kilometer/s as input, and student or elderly passengers will pay the discounted rate, disabled passengers will get an additional 10% discount with the original discounted rate, otherwise the regular fare will be used as basis for the computation of fare. The output will be the total fare for the passenger.

1Using the np.array function create an np array from the data given above.

2Generate a scatter plot for the data.

3Plot dendrogram to visualize the clustering linkage


Data:[[5,3], [10,15], [15,12], [24,10], [30,30], [85,70], [71,80], [60,78], [70,55], [80,91],]


Write a python function Read_Prime(fname, list) which takes a list of numbers as an input, use this number to write them in a file "primes.txt" . The function then read the file and return a list containing only prime numbers as shown in the example. Also, write the exception handling code to show the proper message


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS