Topic: Linked List Problem / Level: intermediate

Problem: Write a function to split a sorted singly linked list into two lists such that the first list contains prime numbers and the second contains non-prime numbers.

Run the code to see the output here...