Want to solve this problem? Login now to get access to solve the problems

Problem

Submissions

Solution

Leaderboard

Coming soon

2

Difficulty: EASY

Avg. time to solve

10 min

Success Rate

90%

Problem Statement

Suggest Edit

```
Line 1 : Linked list elements of length n (separated by space and terminated by -1)
```

```
Updated list elements (separated by space)
```

```
1 <= N <= 10^4
```

```
12 5 2 8 -1
```

```
-1 at the end of input is just a terminator representing the end of linked list. This -1 is not part of the linked list. Size of given linked list is 4.
```

```
2 5 8 12
```

Want to solve this problem? Login now to get access to solve the problems