answer.
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
dedylja
2 months ago
10

HackerCards is a trendy new card game. Each type of HackerCard has a distinct ID number greater than or equal to 1, and the cost

of each HackerCard equals its ID number. For example, HackerCard 1 costs 1, HackerCard 5 costs 5, and so on. #!/bin/python3 10 11 # Complete the hackerCards function below. 12 def hackerCards (collection, d): 13 14 > if _name == '__main__':. Leanne already has a collection started. For her birthday, Mike wants to buy her as many cards as he can given his budget. He wants to buy one each of some cards she doesn't already have. If he has to make one choice among several, he will always choose the lowest cost option. Determine which cards he will buy For example, Leanne's collection = [2, 4, 5] and Mike has d = 7 to spend. He can purchase a maximum of 2 cards, the 1 and the 3 to add to her collection. Two other options he has are 1 and 6 (costs more) or 7(fewer cards, costs more). Function Description Complete the function hackerCards in the editor below. The function must return an array of integer ID's of the cards Mike will purchase in ascending order. hackerCards has the following parameter(s): collection(collection [O)....collection(n-1)]: an array of integer ID numbers of cards in Leanne's collection d: an integer that denotes Mike's budget Constraints ⢠1sns 105 ⢠1s collection[i] $ 109, where Osi
Computers and Technology
1 answer:
zubka84 [1K]2 months ago
5 0

Answer:

No estoy seguro si esto es correcto, la salida es {1,3}

Explanation:

You might be interested in
You are given a string of n characters s[1 : : : n], which you believe to be a corrupted text document in which all punctuation
ivann1987 [1066]

Response: explained in the explanation section

Explanation:

Given that:

Assume D(k) =║ true if [1::: k] is a valid sequence of words, or false otherwise

  • In determining D(n)

the sub problem s[1::: k] is a valid sequence of words IFF s[1::: 1] is valid and s[ 1 + 1::: k] is a valid word.

Thus, we derive that D(k) is defined by the following recurrence relation:

D(k) = ║ false max(d[l] ∧ DICT(s[1 + 1::: k]) otherwise

Algorithm:

Valid sentence (s,k)

D [1::: k]             ∦ array of boolean variables.

for a ← 1 to m

do;

d(0) ← false

for b ← 0 to a - j

for b ← 0 to a - j

do;

if D[b] ∧ DICT s([b + 1::: a])

d (a) ← True

(b). Algorithm Output

      if D[k] == True

stack = temp stack            ∦stack assists in displaying the strings in order

c = k

while C > 0

stack push (s [w(c)]::: C] // w(p) denotes the index in s[1::: k] of the valid word // at position c

P = W (p) - 1

output stack

= 0 =

cheers, I hope this aids you!!!

8 0
1 month ago
Which decimal value (base 10) is equal to the binary number 1012?
Natasha_Volkova [1026]

Answer:

The decimal representation of 101₂² from base 2 equals 25 in base 10.

Explanation:

To derive the decimal equivalent of 101₂²;

101₂ × 101₂ results in 101₂ + 0₂ + 10100₂.

In this expression, we observe that the '2' in the hundred's place must be converted to '0' while carrying over '1' to the thousand's position, leading to;

101₂ + 0₂ + 10100₂ = 11001₂.

This shows that;

101₂² =  11001₂.

Next, we convert the outcome of squaring the base 2 number, 11001₂, into base 10 through the following method;

Converting 11001₂ to base 10 results in;

1 × 2⁴ + 1 × 2³ + 0 × 2² + 0 × 2¹ + 1 × 2⁰.

The calculation yields;

16 + 8 + 0 + 0 + 1 = 25₁₀.

7 0
1 month ago
Sushant is a new manager and he wants to share his ideas and working protocol with his team.Compare the advantages and disadvant
oksian1 [950]

Answer:

Benefits of Oral Communication

  1. Utilizing visual aids such as PowerPoint during discussions can enhance his team's understanding of his concepts and procedures.
  2. Staff responses tend to be more immediate and sincere compared to written replies.

Drawbacks of Oral Communication

  1. If Sushant struggles with stage fright or lacks strong communication skills, it may negatively impact the team's perception of him.
  2. There is a risk that staff may forget portions of Sushant's spoken communication, as written information is generally more reliable for retention.

Benefits of Written Communication

  1. A well-crafted memo articulates Sushant's ideas and procedures clearly to the staff.
  2. A feedback questionnaire could be included for staff input.
  3. Clearly stated goals and objectives.

Drawbacks of Written Communication

  1. Excessively lengthy written material may pose challenges for comprehension or retention.

It is advisable for Sushant to prioritize written communication to share his ideas and protocols effectively.

3 0
2 months ago
How can you check an orthographic drawing to be sure there are no missing lines
maria [1035]
Using a magnifying glass.
4 0
1 month ago
Brendan is examining a report using the Design view. Which section in the Design view is going to appear only once on the first
maria [1035]

The Report Header Section is the part in Design view that appears only on the first page and may include logos and title details.

Clarification:

In Design view, the Create tab allows for report creation with just a click. The Report Wizard can also assist in generating reports with various options.

After initiating a report, you will realize that it contains multiple sections, requiring decisions on the data to be included in each section.

The Report Header Section shows at the top of the first page and only once during the report generation. It features elements like the logo, report title, and current date.

3 0
1 month ago
Other questions:
  • Write a function solution that returns an arbitrary integer which is greater than n.
    13·1 answer
  • Write a program that allows the user to navigate the lines of text in a file. The program should prompt the user for a filename
    6·2 answers
  • List at least six things you would check for if you were asked to evaluate the workspace of an employee for ergonomics
    10·1 answer
  • How has the development of personal computer hardware and software reversed some of the trends brought on by the industrial revo
    15·1 answer
  • Write the definition of a function power_to, which receives two parameters. The first is a float and the second is an integer. T
    5·1 answer
  • 3. What is the error in the following pseudocode? // The searchName function accepts a string containing the name // to search f
    6·1 answer
  • When adopting and implementing a Software as a Service (SaaS) platform such as Salesforce for your business, which responsibilit
    7·1 answer
  • A router has a valid operating system and a configuration file stored in nvram. the configuration file contains an enable secret
    10·1 answer
  • Write an if-else statement with multiple branches. If givenYear is 2101 or greater, print "Distant future" (without quotes). Els
    15·2 answers
  • There are two algorithms called Alg1 and Alg2 for a problem of size n. Alg1 runs in n2 microseconds and Alg2 runs in 100n log n
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!