875. Convert Array to Doubly Linked List
Given an array arr, convert it into a doubly linked list and return the head of the list.
Example 1:
Input: arr = [1, 2, 3, 4]
Output: [1, 2, 3, 4]
Example 2:
Input: arr = [7, 7]
Output: [7, 7]
Now Your Turn!
Pick the correct output for the given inputInput: nums = [3]
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- n == nums.length
- 0 <= n <= 100
- 0 <= nums[i] <= 100