摘要: Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10^n. Example: Input: 2 Output: 91 Explanation: The answer shou 阅读全文
posted @ 2018-11-16 13:03 KeepAC 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 667 是很坑爹的一个题目,乍一看和 526 如出一辙, 526. Beautiful Arrangement 题意: 构造 [1,n]的排列,让每个 a[index] % index ==0 或者 index %a[index] ==0, 基本和 46 题一样,就是构造排列。 667题意: 给定两 阅读全文
posted @ 2018-11-16 12:31 KeepAC 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 给一个数N, 产生 一个数列的排列 [1,2,..n] 这个数列符合如下条件 : 第index 个数满足两个条件的一个 :1. index % a[index] ==0 或者 2. a[index]%index ==0 分析: 和 46 permutations 完全一样, 只是需要在dfs 过程中 阅读全文
posted @ 2018-11-16 06:11 KeepAC 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 842. Split Array into Fibonacci Sequence 和306几乎一样的代码,只是需要return 结果,而不是判断是否符合条件。 结果必须得是 Integer ,因此 字符串长度 不会 长于 Integer 长度10. 因此加了 for(int i=1; i<=(s.l 阅读全文
posted @ 2018-11-16 05:38 KeepAC 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 294. 在293基础上问你 starting player 是否一定能赢。 分析: 两个player 成为 play0 和 play1, 存在一条路径,让 play0 做出某个选择, play1 无论如何选择 最终都能导致 play1 fail 掉。 阅读全文
posted @ 2018-11-16 04:27 KeepAC 阅读(157) 评论(0) 推荐(0) 编辑