自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(95)
  • 资源 (3)
  • 问答 (1)
  • 收藏
  • 关注

原创 415. Add Strings (计算由两个字符串表示的数字相加之和)

Given two non-negative numbers num1 and num2 represented as string, return the sum of num1 and num2.Note:The length of both num1 and num2 is Both num1 and num2 contains only digits 0-9.B

2016-10-28 11:46:40 581

原创 412. Fizz Buzz

Write a program that outputs the string representation of numbers from 1 to n.But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”.

2016-10-28 11:46:04 353

原创 409. Longest Palindrome (计算可由一个字符串中数字字符构成的最长回文数的长度)

Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters.This is case sensitive, for example "Aa" is not con

2016-10-28 11:44:21 576

原创 405. Convert a Number to Hexadecimal (将一个数转换为16进制表示)

Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used.Note:All letters in hexadecimal (a-f) must be in lowercase.The hexade

2016-10-28 11:43:23 440

原创 404. Sum of Left Leaves (二叉树中左叶子值之和)

Find the sum of all left leaves in a given binary tree.Example: 3 / \ 9 20 / \ 15 7There are two left leaves in the binary tree, with values 9 and 15 respectively. Return 24

2016-10-28 11:41:12 978

原创 401. Binary Watch (二进制手表)

A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59).Each LED represents a zero or one, with the least significant bit o

2016-10-28 11:40:08 951

原创 400. Nth Digit (找第n个数字)

Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...Note:n is positive and will fit within the range of a 32-bit signed integer (n 31).Example 1:Input

2016-10-28 11:39:22 901

原创 396. Rotate Function

Given an array of integers A and let n to be its length.Assume Bk to be an array obtained by rotating the array A k positions clock-wise, we define a "rotation function" F on A as follow:

2016-10-28 11:38:45 301

原创 389. Find the Difference

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 at a random position.Find the letter that was

2016-10-28 11:37:49 289

原创 387. First Unique Character in a String (返回字符串中第一个不重复元素的下标)

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"return 0.s = "loveleetcode",return 2.Note: 

2016-10-28 11:36:58 506

原创 383. Ransom Note

Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from the magazines ; ot

2016-10-28 11:34:11 710

原创 374. Guess Number Higher or Lower

We are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong, I'll tell you whether the number is h

2016-10-28 11:32:28 365

原创 371. Sum of Two Integers (实现二进制全加器)

Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example:Given a = 1 and b = 2, return 3.public class Solution { public int getSum(int a, in

2016-10-28 11:30:48 613

原创 350. Intersection of Two Arrays II (求两个数组的交集,包含重复元素)

Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].Note:Each element in the result should appear as ma

2016-10-28 11:29:14 738

原创 349. Intersection of Two Arrays (求两个数组的交集,不包含重复元素)

Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].Note:Each element in the result must be unique.T

2016-10-28 11:27:56 808

原创 345. Reverse Vowels of a String (转置字符串中的元音字母)

Write a function that takes a string as input and reverse only the vowels of a string.Example 1:Given s = "hello", return "holle".Example 2:Given s = "leetcode", return "leotcede".Note

2016-10-28 11:27:04 432

原创 344. Reverse String (转置字符串)

Write a function that takes a string as input and returns the string reversed.Example:Given s = "hello", return "olleh".public class Solution { public String reverseString(String s) {

2016-10-28 11:26:26 2650

原创 342. Power of Four (判断一个数是否为4的幂)

Given an integer (signed 32 bits), write a function to check whether it is a power of 4.Example:Given num = 16, return true. Given num = 5, return false.Follow up: Could you solve it without

2016-10-28 11:24:48 430

原创 326. Power of Three (判断一个数是否为3的幂)

Given an integer, write a function to determine if it is a power of three.Follow up:Could you do it without using any loop / recursion?解法一:使用循环public class Solution { public boolean is

2016-10-28 11:19:26 2337

原创 303. Range Sum Query - Immutable (计算数组中下标i,j之间元素值的和)

Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive.Example:Given nums = [-2, 0, 3, -5, 2, -1]sumRange(0, 2) -> 1sumRange(2, 5) -> -1sumRan

2016-10-28 11:11:27 834

原创 292. Nim Game

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 stones. The one who removes the last stone will be the

2016-10-28 11:10:29 332

原创 290. Word Pattern

Given a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str.

2016-10-28 10:34:23 379

原创 283. Move Zeroes (将数组中值为0的元素移到末尾)

Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For example, given nums = [0, 1, 0, 3, 12], after calling you

2016-10-28 10:33:09 545

原创 278. First Bad Version (查找第一个错误版本)

You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the

2016-10-28 10:32:06 1314

原创 263. Ugly Number

Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 14 is not ugly sinc

2016-10-28 10:31:10 248

原创 258. Add Digits

Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the process is like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has on

2016-10-28 09:54:21 260

原创 257. Binary Tree Paths (求二叉树中所有根到叶子的路径)

Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths are:["1->2->5", "1->3"]/**

2016-10-28 09:53:29 342

原创 242. Valid Anagram (异序词)

Given two strings s and t, write a function to determine if t is an anagram of s.For example,s = "anagram", t = "nagaram", return true.s = "rat", t = "car", return false.Note:You may ass

2016-10-28 09:52:31 296

原创 237. Delete Node in a Linked List (删除单链表中的指定节点)

Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with value

2016-10-28 09:50:38 1312

原创 235. Lowest Common Ancestor of a Binary Search Tree (求二叉树中两个节点的最近公共祖先)

Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined betw

2016-10-28 09:49:35 430

原创 234. Palindrome Linked List (回文链表判断)

Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?/** * Definition for singly-linked list. * public class ListNode { *

2016-10-28 09:49:00 657

原创 232. Implement Queue using Stacks (用栈实现队列)

Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front of queue.peek() -- Get the front element.empty(

2016-10-28 09:46:27 352

原创 231. Power of Two (判断一个数是否是2的幂)

Given an integer, write a function to determine if it is a power of two.public class Solution { public boolean isPowerOfTwo(int n) { return n>0&&Integer.bitCount(n)==1;//Integer.bitCount

2016-10-28 09:45:26 879

原创 226. Invert Binary Tree (交换二叉树左右子树)

Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1/** * Definition for a binary tree node. * public class TreeNode {

2016-10-28 09:43:17 794

原创 225. Implement Stack using Queues (用队列实现栈)

Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get the top element.empty() -- Return whet

2016-10-28 09:42:00 320

原创 223. Rectangle Area (求两矩形重合部分的面积)

Find the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by its bottom left corner and top right corner as shown in the figure.Assume that the tota

2016-10-28 09:41:07 763

原创 219. Contains Duplicate II (判断数组中是否有重复元素且其下标之差不超过k)

Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j]and the difference between i and j is at most k.i

2016-10-28 09:40:02 670

原创 217. Contains Duplicate (判断数组中是否有重复元素)

Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element

2016-10-28 09:38:19 462

原创 206. Reverse Linked List (转置单链表)

Reverse a singly linked list.Hint:A linked list can be reversed either iteratively or recursively. Could you implement both?解法一:(递归)/** * Definition for singly-linked list. * public

2016-10-27 23:41:57 896

原创 205. Isomorphic Strings (同构字符串判断)

Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occurrences of a character must be replaced with anot

2016-10-27 23:40:39 675

Git-2.11.0-64-bit.exe

Git安装程序,2.11.0版本,64位

2017-01-07

mybatis-generator-core-1.3.2.jar 

通过数据表逆向生成po,映射文件和mapper接口

2017-01-05

maven核心程序apache-maven-3.3.9-bin

maven核心程序,版本为3.3.9,可以配合最新版的eclipse4.6.1使用,可以指定通过maven创建的工程的jdk版本为1.8

2017-01-02

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除