split circular linked list
Submit solution
Python
Points:
50 (partial)
Time limit:
8.0s
Memory limit:
64M
Author:
Problem type
Allowed languages
Split Circular Linked List Into Two Equal halves
Given a circular linked list, Your task is to divide the list into 2 equal halves.
Input Format
First line contain N, the number of nodes in the list. Second line contain line contain N space separated integers denoting value at nodes in circular linked list.
Constraints
1 <= N <= 8
Output Format
Output 2 equal list in separate line.
Sample TestCase 1
Input
6
17 22 13 14 15 16
Output
17 22 13
14 15 16
Sample TestCase2
Input
10
17 22 13 14 15 16 2 4 5 6
Output
0
Comments