摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. 阅读全文
posted @ 2019-04-26 10:43 yjxyy 阅读(220) 评论(0) 推荐(0)
摘要: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. 阅读全文
posted @ 2019-04-26 10:40 yjxyy 阅读(153) 评论(0) 推荐(0)
摘要: Given a linked list, remove the *n*-th node from the end of list and return its head. 阅读全文
posted @ 2019-04-26 10:37 yjxyy 阅读(109) 评论(0) 推荐(0)
摘要: 输入n个整数,找出其中最小的K个数。例如输入4,5,1,6,2,7,3,8这8个数字,则最小的4个数字是1,2,3,4,。 阅读全文
posted @ 2019-04-26 10:34 yjxyy 阅读(137) 评论(0) 推荐(0)
摘要: 数组中有一个数字出现的次数超过数组长度的一半,请找出这个数字。例如输入一个长度为9的数组{1,2,3,2,2,2,5,4,2}。由于数字2在数组中出现了5次,超过数组长度的一半,因此输出2。如果不存在则输出0。 阅读全文
posted @ 2019-04-26 10:31 yjxyy 阅读(142) 评论(0) 推荐(0)
摘要: 输入一个字符串,按字典序打印出该字符串中字符的所有排列。例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,bca,cab和cba。 阅读全文
posted @ 2019-04-26 10:27 yjxyy 阅读(168) 评论(0) 推荐(0)