Category: c / c++
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 …
Given a 2D grid of size n * m and an integer k. You need to shift the grid k times. In one shift operation: Element at grid becomes …
We talked about std::fill() that we can use to copy over a single value to a range [First, Last). If you know the number of elements you want to …