2014年11月10日

Add Binary

摘要: Add BinaryGiven two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100". 1 public class Solution { 2 publ... 阅读全文

posted @ 2014-11-10 21:37 luckygxf 阅读(129) 评论(0) 推荐(0) 编辑

Plus One

摘要: Plus OneGiven a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant dig... 阅读全文

posted @ 2014-11-10 20:55 luckygxf 阅读(178) 评论(0) 推荐(0) 编辑

Remove Element

摘要: Remove ElementGiven an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. ... 阅读全文

posted @ 2014-11-10 20:36 luckygxf 阅读(196) 评论(0) 推荐(0) 编辑

Remove Nth Node From End of List

摘要: Remove Nth Node From End of ListGiven a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2... 阅读全文

posted @ 2014-11-10 20:12 luckygxf 阅读(180) 评论(0) 推荐(0) 编辑

Longest Common Prefix

摘要: Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings. 1 public class Solution { 2 public Str... 阅读全文

posted @ 2014-11-10 19:07 luckygxf 阅读(191) 评论(0) 推荐(0) 编辑

Roman to Integer

摘要: 这道题我是按定义来做的Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999. 1 package com.gx... 阅读全文

posted @ 2014-11-10 18:40 luckygxf 阅读(207) 评论(0) 推荐(0) 编辑

Min Stack

摘要: Min StackDesign a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -... 阅读全文

posted @ 2014-11-10 14:59 luckygxf 阅读(167) 评论(0) 推荐(0) 编辑

导航