自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Final Fantasy

目标: Know something of everything, know everything of something.

  • 博客(19)
  • 资源 (3)
  • 收藏
  • 关注

原创 LeetCode 398. Random Pick Index

public class Solution { Map map; Random random; public Solution(int[] nums) { map = new HashMap(); random = new Random(); for (int i = 0; i < nums.length; i++) { if (ma

2017-01-20 22:08:15 199

原创 LeetCode 435. Non-overlapping Intervals

/** * Definition for an interval. * public class Interval { * int start; * int end; * Interval() { start = 0; end = 0; } * Interval(int s, int e) { start = s; end = e; } * } */

2017-01-16 21:14:36 241

原创 LeetCode 137. Single Number II

public class Solution { public int singleNumber(int[] nums) { int r = 0; for (int i = 0; i < 32; i++) { int bit = 1 << i; int sum = 0; for (int j = 0; j

2017-01-15 22:22:09 205

原创 LeetCode 394. Decode String

public class Solution { public String decodeString(String s) { int start = 0; int end = 0; int repeat = 0; int brackets = 0; StringBuilder sb = new StringBu

2017-01-15 21:59:52 242

原创 LeetCode 108. Convert Sorted Array to Binary Search Tree

/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ public class Solution {

2017-01-12 20:17:29 302

原创 LeetCode 46. Permutations

public class Solution { public List> permute(int[] nums) { List> list = new ArrayList>(); int len = nums.length; if (len == 1) { List l = new ArrayList();

2017-01-12 19:38:23 211

原创 LeetCode 337. House Robber III

/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ public class Solution {

2017-01-09 20:46:38 270

原创 LeetCode 328. Odd Even Linked List

/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ public class Solution { public ListNode oddE

2017-01-08 19:33:14 223

原创 LeetCode 22. Generate Parentheses

public class Solution { public List generateParenthesis(int n) { List list = new ArrayList(); Map map = new HashMap(); map.put("", 0); for (int i = 0; i < n * 2; i++) {

2017-01-05 21:50:15 301

原创 LeetCode 216. Combination Sum III

public class Solution { public List<List<Integer>> combinationSum3(int k, int n) { return findNum(k, 1, n); } private List<List<Integer>> findNum(int k, int start, int n) { if (start > n) return null; List<List<Integer>>

2017-01-05 20:18:28 221

原创 LeetCode 319. Bulb Switcher

public class Solution { public int bulbSwitch(int n) { return (int)Math.sqrt(n); } }

2017-01-04 21:15:44 218

原创 LeetCode 230. Kth Smallest Element in a BST

/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ public class Solution {

2017-01-03 21:19:56 235

原创 LeetCode 423. Reconstruct Original Digits from English

public class Solution { public String originalDigits(String s) { int[] digits = new int[10]; for (int i = 0; i < s.length(); i++) { switch(s.charAt(i)) { case 'z'

2017-01-03 20:34:13 280

原创 LeetCode 318. Maximum Product of Word Lengths

public class Solution { public int maxProduct(String[] words) { int max = 0; int l = words.length; int[] values = new int[l]; for (int i = 0; i < l; i++) {

2017-01-02 19:51:54 285

原创 LeetCode 454. 4Sum II

public class Solution { public int fourSumCount(int[] A, int[] B, int[] C, int[] D) { Map map = new HashMap(); for (int i = 0; i < A.length; i++) { for (int j = 0; j < B.l

2017-01-01 21:39:29 286

原创 LeetCode 449. Serialize and Deserialize BST

/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ public class Codec {

2017-01-01 21:17:20 514

原创 LeetCode 12. Integer to Roman

public class Solution { public String intToRoman(int num) { StringBuilder sb = new StringBuilder(); char[] ones = {'I', 'X', 'C', 'M'}; char[] fives = {'V', 'L', 'D'};

2017-01-01 20:09:46 313

原创 LeetCode 144. Binary Tree Preorder Traversal

/** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { val = x; } * } */ public class Solution {

2017-01-01 14:42:59 188

原创 LeetCode 477. Total Hamming Distance

public class Solution { public int totalHammingDistance(int[] nums) { int total = 0; int l = nums.length; for (int i = 0; i < 32; i++) { int count = 0; fo

2017-01-01 14:37:55 196

Deep Learning中文版

《Deep Learning》中文版(印前版)正式发布。这本书适合于各类读者,尤其是学习机器学习的本科或研究生、深度学习和人工智能的研究者、或没有机器学习与统计背景的软件工程师。

2017-05-02

WBAN 802.15.6协议

IEEE 802.15.6 WBAN协议

2016-12-13

空空如也

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

TA关注的人

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