### 每周一道算法题

20 已关注
62篇博文
• #### 数独的Java版解法

最近偶尔有玩数独，有的题太复杂了不好解，刚好看到LeetCode上有这样的题，就尝试写了个Java的解法。1. 数独介绍数独盘面是个九宫，每一宫又分为九个小格。在这八十一格中给出一定的已知数字和解题条...

4小时前
111
• #### Leet Code OJ 3. Longest Substring Without Repeating Characters

题目Given a string, find the length of the longest substring without repeating characters.Examples:Giv...

2017-02-14 14:16
830
• #### Leet Code OJ 4. Median of Two Sorted Arrays [Difficulty: Hard]

题目There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the tw...

2017-02-10 07:36
442
• #### Leet Code OJ 388. Longest Absolute File Path [Difficulty: Medium]

题目 Suppose we abstract our file system by a string in the following manner: The string “dir\n\tsub...

2017-02-06 13:16
426
• #### Leet Code OJ 482. License Key Formatting [Difficulty: Medium]

给定一个非空字符串S，代表一个软件授权秘钥，我们需要格式化这个秘钥。这个字符串由字母、数字(a-z and/or A-Z and/or 0-9)和中划线(-)组成。中划线把字符串S分为几个组（例如有M...

2017-02-04 06:28
622
• #### Leet Code OJ 91. Decode Ways [Difficulty: Medium]

题目： A message containing letters from A-Z is being encoded to numbers using the following mapping:'...

2016-06-24 13:57
3735
• #### Leet Code OJ 344. Reverse String [Difficulty: Easy]

题目： Write a function that takes a string as input and returns the string reversed. Example: Given...

2016-06-23 13:50
3324
• #### Leet Code OJ 15. 3Sum[Difficulty: Medium]

题目： Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find a...

2016-05-04 13:21
2301
• #### Leet Code OJ 28. Implement strStr() [Difficulty: Easy]

题目： Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if...

2016-04-28 16:46
1946
• #### Leet Code OJ 14. Longest Common Prefix [Difficulty: Easy]

题目： Write a function to find the longest common prefix string amongst an array of strings.翻译： 写一个函...

2016-03-25 18:36
1099
• #### Leet Code OJ 125. Valid Palindrome [Difficulty: Easy]

题目： Given a string, determine if it is a palindrome, considering only alphanumeric characters and i...

2016-03-25 13:20
1318
• #### Leet Code OJ 20. Valid Parentheses [Difficulty: Easy]

题目： Given a string containing just the characters , determine if the input string is valid.The brac...

2016-03-24 13:22
2205
• #### Leet Code OJ 2. Add Two Numbers [Difficulty: Medium]

题目： You are given two linked lists representing two non-negative numbers. The digits are stored in ...

2016-03-23 13:48
1673
• #### Leet Code OJ 119. Pascal's Triangle II [Difficulty: Easy]

题目： Given an index k, return the kth row of the Pascal’s triangle. For example, given k = 3, Retu...

2016-03-22 13:54
963
• #### Leet Code OJ 118. Pascal's Triangle [Difficulty: Easy]

题目： Given numRows, generate the first numRows of Pascal’s triangle. For example, given numRows = 5...

2016-03-22 11:32
1067
• #### Leet Code OJ 8. String to Integer (atoi) [Difficulty: Easy]

题目： Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input ca...

2016-03-22 10:43
2980
• #### Leet Code OJ 338. Counting Bits [Difficulty: Medium]

题目： Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate...

2016-03-18 18:32
1442
• #### Leet Code OJ 203. Remove Linked List Elements [Difficulty: Easy]

题目： Remove all elements from a linked list of integers that have value val.Example Given: 1 –> 2 –...

2016-03-17 23:35
1133
• #### Leet Code OJ 107. Binary Tree Level Order Traversal II [Difficulty: Easy]

题目： Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from...

2016-03-17 20:30
1112
• #### Leet Code OJ 88. Merge Sorted Array [Difficulty: Easy]

题目： Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Not...

2016-03-17 13:17
1336