Topic: Linked List Problem / Level: intermediate

Problem: Write a function to split a sorted doubly linked list into two lists where one contains prime numbers and the other contains non-prime numbers.

Run the code to see the output here...