[leetcode]Permutation Sequence @ Python - 南郭子綦 - 博客园: " res = ''
k -= 1
fac = 1
for i in range(1, n): fac *= i
num = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in reversed(range(n)):
curr = num[k/fac]
res += str(curr)
num.remove(curr)
if i !=0:
k %= fac
fac /= i
return res"
'via Blog this'
Blog Archive
-
▼
2014
(190)
-
▼
September
(29)
- [Leetcode] Longest Valid Parentheses @Python - Sum...
- 霸气侧漏的在读博士
- Programming Interview Questions
- temp
- InstallingANewHardDrive - Community Help Wiki
- Clustering With K-Means in Python | The Data Scien...
- LeetCode题解整理版(二) | Coding 4 Fun
- [leetcode]Simplify Path @ Python - 南郭子綦 - 博客园
- [leetcode]Implement strStr() @ Python - 南郭子綦 - 博客园
- [leetcode]Valid Palindrome @ Python - 南郭子綦 - 博客园
- [leetcode]Copy List with Random Pointer @ Python -...
- [leetcode]Swap Nodes in Pairs @ Python - 南郭子綦 - 博客园
- [leetcode]Remove Nth Node From End of List @ Pytho...
- [leetcode]Add Two Numbers @ Python - 南郭子綦 - 博客园
- [leetcode]Rotate List @ Python - 南郭子綦 - 博客园
- [leetcode]Plus One @ Python - 南郭子綦 - 博客园
- [leetcode]Valid Sudoku @ Python - 南郭子綦 - 博客园
- How to Read Linux Top Command Output and Uses - Te...
- [leetcode]Valid Sudoku @ Python - 南郭子綦 - 博客园
- Dropped iphone 5 in water. Help? | Apple Support C...
- [leetcode]Permutation Sequence @ Python - 南郭子綦 - 博客园
- C++11 improvements over C++03
- K-means算法及k-means++、SVD的优化 - 推酷
- Programming Interview Questions
- 统计学习笔记(2)——感知机模型 - Liam Q的专栏 - 博客频道 - CSDN.NET
- 科学网—[转载]常见面试之机器学习算法思想简单梳理 - 李建扣的博文
- soulmachine/machine-learning-cheat-sheet
- 美国一类优先移民EB1A
- c++ - Compiling C++11 with g++
-
▼
September
(29)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment