Category: algorithms
ou are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contain a single digit. Add the two …
We are given that the string “abc” is valid. From any valid string V, we may split V into two pieces X and Y such that X + Y …
Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Input: Output: 2 Explanation: is the longest contiguous …
You are given an immutable linked list, print out all values of each node in reverse with the help of the following interface: ImmutableListNode: An interface of immutable linked …
Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULL Output: 5->->->2->1->NULL Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? Reversing a linked …