Guidelines

Coding Quiz

In this coding quiz, you need to write a solution function that implements a queue for managing tasks using Python's list.

Several tasks are provided as input, and these tasks should be stored in a queue that follows a FIFO (First-In-First-Out) order.

The solution function should process the given list of tasks and return the results in the order they were processed.

Implement the queue using the list's append and pop methods.

Code Template
def solution(tasks): # Write your code here return

Constraints

  • Tasks are represented as integers and have values between 1 and 100 inclusive.

  • The length of the task list is between 1 and 10 inclusive.

  • The order of task processing in the queue must be maintained.


Input and Output Examples

  • Input: [3, 2, 4, 1]

  • Output: [3, 2, 4, 1]

Guidelines

AI Tutor

Publish

Design

Upload

Notes

Favorites

Help