【LeetCode】476. Number Complement (java实现)

原题链接https://leetcode.com/problems/number-complement/原题Given a positive integer, output its complement number. The complement strategy is to flip the ...

2017-01-26 06:59:38

阅读数 2508

评论数 1

【LeetCode】461. Hamming Distance (java实现)

原题链接https://leetcode.com/problems/hamming-distance/原题The Hamming distance between two integers is the number of positions at which the corresponding ...

2017-01-05 22:51:29

阅读数 4526

评论数 0

【LeetCode】475. Heaters (java实现)

原题链接https://leetcode.com/problems/heaters/原题Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius...

2016-12-28 23:07:53

阅读数 2971

评论数 0

【LeetCode】455. Assign Cookies (java实现)

原题链接https://leetcode.com/problems/assign-cookies/原题Assume you are an awesome parent and want to give your children some cookies. But, you should give...

2016-11-29 05:33:35

阅读数 1571

评论数 0

【LeetCode】396. Rotate Function(java实现)

原题链接https://leetcode.com/problems/rotate-function/原题Given an array of integers A and let n to be its length. Assume Bk to be an array obtained by ro...

2016-11-18 06:06:05

阅读数 634

评论数 0

【LeetCode】409. Longest Palindrome (java实现)

原题链接https://leetcode.com/problems/longest-palindrome/原题Given a string which consists of lowercase or uppercase letters, find the length of the longes...

2016-11-13 07:26:35

阅读数 822

评论数 0

【LeetCode】405 Convert a Number to Hexadecimal (java实现)

原题链接https://leetcode.com/problems/convert-a-number-to-hexadecimal/原题Given an integer, write an algorithm to convert it to hexadecimal. For negative i...

2016-11-09 23:33:12

阅读数 1885

评论数 0

【LeetCode】415 Add Strings (java实现)

原题链接https://leetcode.com/problems/add-strings/原题Given two non-negative numbers num1 and num2 represented as string, return the sum of num1 and num2.N...

2016-10-28 07:08:48

阅读数 3960

评论数 2

【LeetCode】401 Binary Watch (java实现)

原题链接https://leetcode.com/problems/binary-watch/原题A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom ...

2016-10-24 07:17:12

阅读数 2476

评论数 0

【LeetCode】400 Nth Digit(java实现)

原题链接https://leetcode.com/problems/nth-digit/原题Find the nthn^th digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, …Note: n is...

2016-10-24 07:15:21

阅读数 1415

评论数 0


在LeetCode中,TreeNode是经常用到的一个结构体,表示数据结构树(Tree)中的一个节点。其官方定义如下: public class TreeNode { int val; TreeNode left; TreeNode right; TreeNode...

2016-10-20 00:39:17

阅读数 11634

评论数 3

【LeetCode】387 First Unique Character in a String(java实现)

原题Given a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return -1.Examples:s = "leetcode"...

2016-10-20 00:37:41

阅读数 2153

评论数 0

【LeetCode】404 Sum of Left Leaves(java实现)

原题Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the binary ...

2016-10-20 00:34:27

阅读数 1519

评论数 0

【LeetCode】389 Find the Difference(java)

原题Given two strings s and t which consist of only lowercase letters.String t is generated by random shuffling string s and then add one more letter a...

2016-09-29 23:46:25

阅读数 794

评论数 1

【LeetCode】383 Ransom Note(java)

原题 题目要求 解法 原题Given
letters from

2016-08-17 17:35:30

阅读数 4284

评论数 0

【LeetCode】345 Reverse Vowels of a String(java)

原题 题目要求 解法 原题Write a function that takes a string as input and reverse only the vowels of a string.Example 1: Given s = “hello”, return “holle”.Exam...

2016-05-04 16:15:30

阅读数 2813

评论数 0

【LeetCode】299 Bulls and Cows (java实现)

原题 题目要求 常规解法 更聪明的代码 原题:You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what ...

2016-04-16 11:01:24

阅读数 1395

评论数 0

【LeetCode】292 Nim Games (java实现)

You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 sto...

2015-12-08 00:04:48

阅读数 675

评论数 0



2015-09-02 23:52:09

阅读数 5398

评论数 0

【LeetCode】141 Linked List Cycle (java实现)

Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? 题目很明确,给定一个链表,判断其中是否包含一个环路。有个额外的...

2015-09-02 23:34:15

阅读数 1442

评论数 0

取消 删除