Author: admin
Home > Articles posted by admin (Page 163)
Problem Description
Find the shortest distance between any two vertices in the graph:
The input contains two integers which contain the starting node and the ending node. The output should contain the distance between two nodes
Sample Input 1:05
Sample Output 1:9
Explanation:Shortest between nodes 0 and 5 is 9....
Posted at 04:28h
in
Uncategorized
by admin
Problem DescriptionYou live in Grid City, which is composed of integer-numbered streets which run east-west (parallel to the x-axis) and integer-numbered avenues which run north-south (parallel to the y-axis). The streets and avenues have infinite length, and there is a street for every integer y-coordinate...
Posted at 04:26h
in
Uncategorized
by admin
Question:
Continue with the game in the previous class and show the crystals when the enemy is shot down, you can download crystal image from following:
...
Question:
You have two strings. Find the number of characters you have to add to make them anagrams of each other.
Sample Input 1:
abc
abd
Sample Output 1:
2
Sample Input 2:
abcd
abc
Sample Output 2:
1
Sample Input 3:
abcd
a
Sample Output 3:
3...
Posted at 04:20h
in
Uncategorized
by admin
Question:
Do you still remember how to split a string and join a list? Roy was trying to record all the money he spend in the trip. However he wrote USD(U.S. Dollar) after each number instead of CAD(Canadian Dollar). Please write a program using the split...
Posted at 19:50h
in
archives
by admin
Question 1:
Write a program to ask the user to enter an ingredient for pizza for 3 times. After entering three ingredients, the program will show the message “We will add …. into your pizza.”.
Sample Input:
Please enter an ingredient for your pizza: mushroom
Please enter an ingredient...
Question:
Eric works in a door mat manufacturing company. One day, he designed a new door mat with the
following specifications:
◦ Mat size must be A x B. (A is an odd natural number, and B is 3 times A.)
◦ The design should have 'WELCOME' written in...
Posted at 17:40h
in
Uncategorized
by admin
Question:
Create a PWD(Password) class it will contain the following methods:
__init__
to create a password object by passing one argument into it
validate
to check the validity of password input by users. it need to use the following method:
checkLetter: At least 1 letter between [a-z] and 1 letter between[A-Z].
checkNumber:...
Posted at 02:43h
in
Uncategorized
by admin
Question:
Eric works in a door mat manufacturing company. One day, he designed a new door mat with the
following specifications:
◦ Mat size must be A x B. (A is an odd natural number, and B is 3 times A.)
◦ The design should have 'WELCOME' written in...