Posted at 04:58h
in
Uncategorized
by admin
Question:
You have come up with the following compression technique: for each symbol, write down the number of times it appears consecutively, followed by the symbol itself. This compression technique is called run-length encoding.
Given a sequence of characters, write a program to encode them in this...
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...