Handle Score
@Ibrahim Nash 6381
@blackshadows 6329
@mb1973 5388
@Quandray 5231
@akhayrutdinov 5111
@saiujwal13083 4510
@sanjay05 3762
@marius_valentin_dragoi 3522
@sushant_a 3459
@verma_ji 3357
@KshamaGupta 3318
Complete Leaderboard
Identical Linked Lists
Basic Accuracy: 51.37% Submissions: 29390 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:

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

Example 2:

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

1 <= N <= 103

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

to report an issue on this page.


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


All Submissions

My Submissions:

Login to access your submissions.

Identical Linked Lists

Output Window