Leaderboard
Showing:
Handle Score
@Ibrahim Nash 6454
@blackshadows 6380
@mb1973 5714
@Quandray 5245
@akhayrutdinov 5111
@saiujwal13083 5046
@sanjay05 3762
@kirtidee18 3709
@mantu_singh 3556
@marius_valentin_dragoi 3523
@sushant_a 3459
Complete Leaderboard
Identical Linked Lists
Basic Accuracy: 51.37% Submissions: 35536 Points: 1

Given two Singly Linked List of N and M nodes respectively. The task is to check whether two linked lists are identical or not. 
Two Linked Lists are identical when they have same data and with same arrangement too.

Example 1:

Input:
LinkedList1: 1->2->3->4->5->6
LinkedList2: 99->59->42->20
Output: Not identical 

Example 2:

Input:
LinkedList1: 1->2->3->4->5
LinkedList2: 1->2->3->4->5
Output: Identical
 

Your Task:
The task is to complete the function areIdentical() which takes the head of both linked lists as arguments and returns True or False
.

Constraints:
1 <= N <= 103

Expected Time Complexity : O(N)
Expected Auxilliary Space : O(1)

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Identical Linked Lists

Output Window