摘要: back function (return number) remember the structure Solution 2: dp keywards: how many ways and optimal 70. Climbing Stairs 阅读全文
posted @ 2018-05-16 12:09 wz30 阅读(98) 评论(0) 推荐(0) 编辑
摘要: using prev // 90 subset2 sorting the array first and check the contains 阅读全文
posted @ 2018-05-15 13:17 wz30 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Permutation the structure of backtracking why copy the list generic list 47: duplicate elements if contains the element why both using visited array B 阅读全文
posted @ 2018-05-14 06:24 wz30 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return all root-to-leaf paths. Note: A leaf is a node with no children. Example: Idea: traverse solution (inorder postorder, preo 阅读全文
posted @ 2018-05-13 14:28 wz30 阅读(219) 评论(0) 推荐(0) 编辑
摘要: beautiful arrangement backtracking for each position check each number. set number to one position 阅读全文
posted @ 2018-05-13 11:11 wz30 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 1. build the graph and then dfs -- graph <String, List<String>>, (the value is sorted and non- duplicate) Collections.sort(value) 2. dfs we use bottom 阅读全文
posted @ 2018-05-11 05:45 wz30 阅读(145) 评论(0) 推荐(0) 编辑
摘要: why pick the long.MIN_VALUE ? beacuse, there is case [1,2, Integer.MIN_VALUE] can not pass it with picking Integer.MIN_VALUE; Follow up what if pick t 阅读全文
posted @ 2018-05-08 01:01 wz30 阅读(114) 评论(0) 推荐(0) 编辑
摘要: https://www.lintcode.com/problem/inverted-index-map-reduce/description -- decription of the map reduce problem 1. click the submit button to view the 阅读全文
posted @ 2018-05-07 12:46 wz30 阅读(422) 评论(0) 推荐(0) 编辑
摘要: description: Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. For example, two is written as II in Roman numeral, ju 阅读全文
posted @ 2018-05-03 12:40 wz30 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Leetcode ugly number set (3 now) new ugly number is generated by multiplying a prime with previous generated ugly numbe Is ugly number or not //simula 阅读全文
posted @ 2018-05-03 11:53 wz30 阅读(195) 评论(0) 推荐(0) 编辑