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

Program


Write a program to print the following, Given a word W and pattern P, you need to check whether the pattern matches the given word.The word will only contain letters(can be Uppercase and Lowercase). The pattern can contain letters, ? and *.

? : Can be matched with any single letter.
* : Can be matched with any sequence of letters (including an empty sequence).


If the pattern matches with the given word, print True else False.


Sample Input1

3

Hello *l?

Hell He?ll

Hell ?*


Sample Output1

True

False

True




ID Card: In Rahul's college, every student is uniquely identified by a string(unique id) which is printed on the ID card of the student.This unique id is comprised if letters and digits separated by hyphens into groups of different lengths.The college administration decides to standardize this unique id on the ID card by regrouping the letters of the previous unique id to a fixed group length.The college administration also does not want to have lowercase letters in the new id .You need to help the college administration with this task.Given the previous id, and the n0.of characters to group (group length),you need to generate the new id.NOTE: While generating the unique id,group the characters from right to left.

INPUT: The first line contains a string S representing a unique id.

Second line contains an integer N representing group length.

OUTPUT: Output should be a single string representing the new unique id.

INPUT:

2-4A0r7-4k

3

OUTPUT:

24-A0R-74K


INPUT:

5F3Z-2e-9-w

4

OUTPUT:

5F3Z-2E9W



#Hi sir We need Exact answer we believe your Experience


Number of moves:

you are given a nxn square chessboard with one bishop and k number of obstacles placed on it. A bishop can go to different places in a single move. find the total no.of places that are possible for the bishop in a single move. Each square is referenced by a type describing the row, R, and column, C, where the square is located.


explanation: given N=6 K=2


bishop position 5 2


obstacle positions (2 2), (1 5)


the bishop can move in so o/p is 6


I/p:


6 2


5 2


2 2


1 6


O/p:


6


I/p:


6 4


3 3


1 3


3 1


5 1


1 5


O/p:

7

Word Rearrange: In word Rearrange players try to score points by forming words using the letters from a 6-letters scrambled word.Given some guessed words,find the total No.of points the players scored in a particular round using the following rubric. 3-letter words are 1 pt, 4-letter words are 2 pts, 5-letter words are 3 pts, 6-letter words are 4 pts+50 pt bonus. A guessed word is invalid if the characters are not present in the scrambled word.Notes-that invalid words count as 0. your task is to find out the final score.

INPUT: The first line contains a string representing a scrambled word. The Second Line contains some spaces-separated strings representing words guessed by the player.


INPUT:

rceast

cat create sat

OUTPUT:

2

INPUT:

tacren

trance recant

OUTPUT:

108


Given a sentence with numbers representing a word's location embedded within each word of given sentence, return the sentence according to the number in each word.




Example:


str = "is2 thi1s T4est 3a"




the word " is2 " contains 2 - so the word "is location is 2


the word "Thi1s" contains 1 - so the word "this" location is 1


the word "T4est" contains 4 - so the word "Test" location is 4


the word "3a" contain 3 - so the word "a" location is 3




this is a Test




Constraints:


only the integers 1-9 will be there




input format :


the first line contains a string input


Input:

is3 cri1stiano 4the rona2ldo 5best


expected output:

cristiano Ronaldo is the best




Given a sentence with numbers representing a word's location embedded within each word of given sentence, return the sentence according to the number in each word.


Example:

str = "is2 thi1s T4est 3a"


the word " is2 " contains 2 - so the word "is location is 2

the word "Thi1s" contains 1 - so the word "this" location is 1

the word "T4est" contains 4 - so the word "Test" location is 4

the word "3a" contain 3 - so the word "a" location is 3


this is a Test


Constraints:

only the integers 1-9 will be there


input format :

the first line contains a string input






























Ramesh and suresh started doing fun activity in which ramesh writes down the word and tell suresh the number of letters in his word. Then suresh tries to guess the word that ramesh had written. After suresh guesses the word they both compare the words to determine the minimum number of letters suresh has to replace his guessed word becomes an anagram of ramesh word.



Note: suresh and ramesh words are same length



Input line contains two space seperated strings



Output must be in single line representing minimum number of letters to be replaced




Input: honey moon



Output: 1



Input: ccbp pbcc



Output: 0




Need correct output sir

Rahul is playing a guessing number game with computer. The objective of the game is to guess the number that computer thinks. A guess is correct when the guess exactly matches with computer number. After each guess by rahul, the computer will give a score comprising of black and white coins.


Black coin== guessed digit is present in the computer number and in same position


White coin== guessed digit is present but in another position..


Your task is to find out the no.of black and no.of.white coins.


Input: first line contains two space seperated integers denoting rahuls guess and computer number.



Input1: 1423 1234


Output: black: 1 white: 3


Input2: 1423 5678


Output: black:0 white: 0



Need correct output sir

  • Need it in the form of a python code for this pseudocode


JamEx Limited requires a program to calculate and print the commission received by a salesperson. The program should process an undetermined number of salespersons and appropriately terminate by a predefined input. The commission rate is based on two factors, the amount of sales and the class to which a salesperson belongs. The input will be the salesperson number, sales amount and class. The commission rate will be based on the following criteria:

Class=1

If sales is equal to or less than $1000, the rate is 6 percent.

If sales is greater than $1000 but less than $2000, the rate is 7 percent.

If the sales is $2000 or greater, the rate is 10 percent.


Class=2

If the sales is less than $1000, the rate is 4 percent.

If the sales is $1000 or greater, the rate is 6 percent.


Class=3 The rate is 4.5 percent for all sales amount


Class=any other value

Output an appropriate error message.


You will be given a list of tuples where each tuple indicates a point i.e. (x, y) in a 2-dimensional coordinate system. You need to write a python program to find the minimum distance and the point that is closest to the origin i.e. (0,0)

Hint:

The formula of distance =√ [ (x₂ - x₁)² + (y₂ - y₁)²]

As you are calculating the distance from the origin (0,0), you can simply use distance = √ [ (x²+y²)] 

You can create a list of distances from each point and sort that list using your personal favorite sorting algorithm.


Sample Input 1 

points = [(5,3), (2,9), (-2,7), (-3,-4), (0,6), (7,2)] 

Sample Output 1 

Minimum distance = 5.0 

Here the closest point is (-3,-4) which has a distance of 5.0 from the origin.


Sample Input 2 

points = [(1,7), (4,5), (-1,7), (-2,0), (1,1), (5,-1)] 

Sample Output 2 

Minimum distance = 1.4142135623730951 Here the closest point is (1,1) which has a distance of 1.4142135623730951 from the origin.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS