![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
振哥在,世界充满爱!
计划+坚持!+思考
展开
-
Java-LeetCode-Add Two Numbers
You are given two linked lists representingtwo non-negative numbers. The digits are stored in reverse order and each oftheir nodes contain a single digit. Add the two numbers and return it as alinke原创 2016-09-06 23:58:59 · 424 阅读 · 0 评论 -
Java-LeetCode-TwoSum
Given an array of integers, return indices ofthe two numbers such that they add up to a specific target.You may assume that each input wouldhave exactly one solution.Example:Given nums = [2, 7原创 2016-09-06 20:35:46 · 567 阅读 · 0 评论 -
Java-LeetCode-Longest Substring Without Repeating Characters
Given a string, find the length of the longestsubstring without repeating characters.Examples: Given "abcabcbb", the answer is "abc", which the length is 3. Given "bbbbb", the an原创 2016-09-07 22:02:21 · 192 阅读 · 0 评论 -
Java-LeetCode-3Sum
Given an array S of n integers,are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in thearray which gives the sum of zero.Note: The solution set must not contain dup原创 2016-09-28 22:17:01 · 262 阅读 · 0 评论 -
NewCoder:Sudoku-Java
题目描述问题描述:数独(Sudoku)是一款大众喜爱的数字逻辑游戏。玩家需要根据9X9盘面上的已知数字,推算出所有剩余空格的数字,并且满足每一行、每一列、每一个粗线宫内的数字均含1-9,并且不重复。输入:包含已知数字的9X9盘面数组[空缺位以数字0表示]输出:完整的9X9盘面数组输入描述:包含已知数字的9X9盘面数组[空缺位以数字0表示]输出描述:完整的9X9盘面数组impor原创 2017-03-14 16:14:29 · 657 阅读 · 0 评论 -
Java-LeetCode-ClimbingStairs
今天看到ClimbingStairs这道题目,发现有多种解法,自己顺便整理了一下。主要的解题方法有三种,其中最重要的是如何将该问题和斐波那契数列进行关联起来:1)递归实现;思路最简单,但n较大时,存储空间变大,且速度变慢。2)迭代实现;类似方法1)。3)采用斐波那契数列的通项公式实现。这里主要是给出斐波那契数列的通项公式的推导过程。先给出代码,后给出推导过程,如下:packag原创 2017-04-24 21:21:08 · 267 阅读 · 0 评论 -
Java-LeetCode-DecodeWays
这道题目的思路和上一篇博客中求ClimbingStairs的求解过程类似,把字符串看作是台阶,不同的数字组合看作是每次攀爬台阶的种数,求解所有字符串中数字的译码方式。在ClimbingStairs中每次攀爬都是1种或2种方式,而在DecodeWays中需要多加入几个逻辑判断,只有在某些情况下才会有两种译码方式,解题思路在代码注释中给出。package LeetCode_chz;import原创 2017-04-24 21:26:03 · 334 阅读 · 0 评论