Category: coding exercise
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 …
Given an array A, partition it into two (contiguous) subarrays left and right so that: Every element in left is less than or equal to every element in right. …
Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example 1: Input: “aba” Output: True Example 2: Input: …
Given a string S of ‘(‘ and ‘)’ parentheses, we add the minimum number of parentheses ( ‘(‘ or ‘)’, and in any positions ) so that the resulting …
A string S represents a list of words. Each letter in the word has 1 or more options. If there is one option, the letter is represented as is. …