Skip to main content
Crowdfunding
Python + AI for Geeks
Practice

Coding Quiz

In this coding quiz, you will write a solution function to implement a Linked List.

You will input several integers, and these integers should be stored in a linked list.

The solution function should construct a linked list with the given integers and output the elements of the list in order.

Code Template
class ListNode:
def __init__(self, value=0, next=None):
self.value = value
self.next = next

def solution(numbers):
# Write your code here
return

Constraints

  • The input integers range from 1 to 100, inclusive.

  • The length of the linked list ranges from 1 to 10, inclusive.

  • Implement the linked list as a basic Singly Linked List.


Input/Output Example

  • Input: [1, 3, 5, 7]

  • Output: [1, 3, 5, 7]

Want to learn more?

Join CodeFriends Plus membership or enroll in a course to start your journey.