摘要:
描述Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.分析暴力算法的复杂度是 O(m ∗ n),代 阅读全文
摘要:
描述Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoringcases.For example,”A man, a plan, a canal: Pan 阅读全文
摘要:
描述Given an array of integers, every element appears three times except for one. Find that single one.Note: Your algorithm should have a linear runtime 阅读全文
摘要:
Single Number描述Given an array of integers, every element appears twice except for one. Find that single one.Note: Your algorithm should have a linear 阅读全文
摘要:
描述Follow up for ”Search in Rotated Sorted Array”: What if duplicates are allowed?Would this affect the run-time complexity? How and why?Write a functi 阅读全文
摘要:
描述Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target va 阅读全文
摘要:
描述Given a sorted array, remove the duplicates in place such that each element appear onlyonce and return the new length.Do not allocate extra space fo 阅读全文
摘要:
Remove Duplicates from Sorted Array II描述Follow up for ”Remove Duplicates”: What if duplicates are allowed at most twice?For example, Given sorted arra 阅读全文