1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
aleksklad [387]
2 years ago
5

An anagram of a string is another string with the same characters in the same frequency, in any order. For example 'ab', 'bca, a

cb), 'bac', 'cba, 'cab' are all anagrams of the string 'abc'. Given two arrays of strings, for every string in one list, determine how many anagrams of it are in the other list. Write a function that receives dictionary and query, two string arrays. It should return an array of integers where each element i contains the number of anagrams of queryll that exist in dictionary.
Computers and Technology
1 answer:
nlexa [21]2 years ago
4 0

Answer:

from collections import Counter

def anagram(dictionary, query):

   newList =[]

   for element in dictionary:          

       for item in query:

           word = 0

           count = 0

           for i in [x for x in item]:

               if i in element:

                   count += 1

                   if count == len(item):

                       newList.append(item)

   ans = list()

   for point in Counter(newList).items():

       ans.append(point)

   print(ans)        

mylist = ['jack', 'run', 'contain', 'reserve','hack','mack', 'cantoneese', 'nurse']

setter = ['ack', 'nur', 'can', 'con', 'reeve', 'serve']

anagram(mylist, setter)

Explanation:

The Counter class is used to create a dictionary that counts the number of anagrams in the created list 'newList' and then the counter is looped through to append the items (tuple of key and value pairs) to the 'ans' list which is printed as output.

You might be interested in
Microsoft words spell checker
Degger [83]
The answer it is A i hope is good
3 0
2 years ago
Consider an online shopping portal that allows a customer to browse and purchase different products. The products are arranged u
o-na [289]
Way too much to read bye
7 0
2 years ago
Read 2 more answers
They will wash the car change into tag question​
valentina_108 [34]

Answer:

They will wash the car, won't they?

Explanation:

A tag question usually comes after an independent clause. The tag question is most times attached with the intent of affirming the statement made in the independent clause. Our independent clause in the answer above is; "They will wash the car". The tag question, "Won't they?" is meant to affirm that statement.

Another example is, "They are going to school, aren't they?" In this example also, the independent clause makes a sentence that is to be confirmed by the tag question.

8 0
2 years ago
Sort the following everyday examples of sedimentary processes into the bins labeled with the sedimentary processes they most clo
Firlakuza [10]

The Sorting of the  examples of sedimentary processes are:

  • Sediment Erosion/transport - The dirt going down the drain after you give your dog a bath and drain the tub Dirt being blown off a patio
  • Deposition of sediment - Dust collecting on furniture
  • Weathering of rock - Tree roots extending into a rock layer and breaking it down Ice expanding in a crack in the road creating a pothole
  • Compaction/lithification - A dump truck dumps a load of gravel on your lawn. The dirt below it becomes more consolidated

<h3>What is the sedimentary process known as?</h3>

Sedimentary rocks are said to be the outcome of

1) The weathering of preexisting rocks,

2) The transport of the weathering products,

3) The  deposition of the material.

4) The  compaction process.

5) The cementation of the sediment to form a rock.

This is known to be the most vital geological processes that has lead to the making of sedimentary rocks such as due to erosion, weathering, dissolution, and others

Therefore, The Sorting of the  examples of sedimentary processes are:

  • Sediment Erosion/transport - The dirt going down the drain after you give your dog a bath and drain the tub Dirt being blown off a patio
  • Deposition of sediment - Dust collecting on furniture
  • Weathering of rock - Tree roots extending into a rock layer and breaking it down Ice expanding in a crack in the road creating a pothole
  • Compaction/lithification - A dump truck dumps a load of gravel on your lawn. The dirt below it becomes more consolidated

See full question below

Sort the following everyday examples of sedimentary processes into the bins labeled with the sedimentary processes they most closely represent. Drag the appropriate items into their respective bins View Available Hint(s) Reset Heip A dump truck dumps a load of gravel on your lawn. The dirt below it becomes more consolidated Dirt being blown off a patio Ice expanding in a crack in the road Dust collecting on furniture creating a pothole Tree roots extending into a rock layer you give your dog The dirt going down the drain after a bath and drain the tub and breaking it down Sediment Erosion/transport Deposition of sediment Weathering of rock Compaction/lithification

Learn more about sedimentary processes from

brainly.com/question/13291293

#SPJ1

4 0
1 year ago
Moon Questions? (diagram attached)
Radda [10]
1). The waxing gibbous phase represents the portion of the cycle of phases
during which the moon appears more than half but less than fully lit, and is growing
as time goes on. In the picture, it's everything from position-3 to position-5. It's
one fourth of the entire cycle, which is 7.4 days, so you'd see it on 7 or 8 consecutive
nights.
(The complete cycle of phases is 29.53 days.)

2). The complete cycle of phases is 29.53 days. Any phase visible on December 21
is visible again on January 19 or January 20.

3). From position-8 to position-5 in the picture is 5/8 of all the way around.
(5/8) of (29.53) = 18.5 days.

4). The locations of high- and low-tides on the Earth are influenced by the position
of the moon and the rotation of the Earth.

5). A lunar eclipse is the result of the moon sailing into the Earth's shadow.
The Earth's shadow is out behind it, opposite to the sun, toward position-5
in the picture, not position-4.
6 0
2 years ago
Other questions:
  • Page orientation can be either landscape or _____.
    13·1 answer
  • Which of the following typically have the highest auto insurance premiums?
    14·1 answer
  • An anthropologist may try to learn why and how a culture develops.<br><br> A.true<br> B.false
    13·1 answer
  • Which of the following is an example of hypertext pattern reading?
    13·1 answer
  • URGENT!!! Which file format is used mainly in the Microsoft Windows operating system?
    15·2 answers
  • A monopoly is a market that has few competing businesses. many sellers of the same item. many sellers of a variety of products.
    8·2 answers
  • Wyatt has a database to keep track of his enormous collection of videos. How can Wyatt find the details for the game Lost on Mar
    11·2 answers
  • In the year, , the American Department of Defense put a military research network, called ARPANET online.
    5·1 answer
  • How is a transaction verified on a cryptocurrency network?.
    14·1 answer
  • I'm not sure how to solve this problem
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!