Embercode
✕
Greedy AlgorithmsQuick quiz

Labels and digits

8 questions. Covers Remove k digits in Python with a list as a stack.

Questions 1 to 5 of 8

  1. 1. What does this print? ``python print(partition_labels("bbcdeffe")) ``
  2. 2. What does this print? ``python print(remove_k_digits("2813", 2)) ``
  3. 3. In partition_labels, a letter's slot is ord(ch) - .... Write the expression that goes after the minus sign so that a becomes slot 0, including the ord call.

    Type your answer.

  4. 4. Write the formula for the length of a part that starts at index start and ends at index reach, with both ends included.

    Type your answer.

  5. 5. Take 112 with one removal. Why does the digit rule pop only when the top is bigger (>), and not when it is equal (>=)?

5 question(s) left on this page.

Typed answers ignore extra spaces and, for most questions, capital letters.