2017年12月18日

Remove Duplicates from Sorted Array

摘要: 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 fo 阅读全文

posted @ 2017-12-18 21:05 夜的第八章 阅读(173) 评论(0) 推荐(0)

merge two sorted lists

摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Example: 阅读全文

posted @ 2017-12-18 20:11 夜的第八章 阅读(177) 评论(0) 推荐(0)

valid parentheses

摘要: parentheses:括号 Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets mus 阅读全文

posted @ 2017-12-18 19:37 夜的第八章 阅读(148) 评论(0) 推荐(0)

Longest Common Prefix

摘要: Write a function to find the longest common prefix string amongst an array of strings. 找出所有字符串中的共同字符串前缀。 方法一:让第一个字符串作为基准,遍历该字符串,依次将该字符串中的每个字符跟其他所有字符串相 阅读全文

posted @ 2017-12-18 19:01 夜的第八章 阅读(183) 评论(0) 推荐(0)

palindrome number(回文数)

摘要: Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, -1) If you are thi 阅读全文

posted @ 2017-12-18 16:30 夜的第八章 阅读(187) 评论(0) 推荐(0)

Two Sum

摘要: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex 阅读全文

posted @ 2017-12-18 14:34 夜的第八章 阅读(152) 评论(0) 推荐(0)

导航