摘要:题目内容: 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 sp
阅读全文
摘要:题目内容: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. 题目分
阅读全文
摘要:题目内容: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close i
阅读全文
摘要:题目内容:Write a function to find the longest common prefix string amongst an array of strings 题目分析:本题目利用字符串数组中的一个字符串作为参考,数组中的所有字符串都和该字符串进行对比,找出所有字符串开头出现字
阅读全文
摘要:题目内容: Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 题目分析:罗马数字向阿拉伯数字的转换情况如下: 1、M=1000 D=5
阅读全文
摘要:题目内容: Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 题目分析:反转的方法很简单,重点在于判断溢出的问题,下面给出了两种方法。 方法一: 判断溢出方法:在执行完
阅读全文
摘要:题目内容: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 ha
阅读全文