Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,“A man, a plan, a canal: Panama” is...
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of th...
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf nod...
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 12...
Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical and the ...
Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:You may assume that nums1 has enough space (size that is gr...
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for anoth...
Given a string, find the length of the longest substring without repeating characters. Examples: Given “abcabcbb”, the answer is “abc”, which the length is 3...
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a sin...
Write a function to find the longest common prefix string amongst an array of strings. 暴力穷举先找出最短的一个字符串,然后遍历这个字符串的每个字符,与其余每个字符串对应的位置做比较,直到找到不同时中止,时间复杂度O(N*M)1...