题意: 如上图所示,将一个字符串进行分割,反转等操作后不同字符串的个数: 例如字符串abba:可以按三种比例分割;1:3;2:2;3:1 部分反转可以得到如下所有的字符串: 去掉重复可以得到六个不同的字符串,输出6;解题思路: 此题用反转函数reverse比较方便,然后就和模拟差不多,要列...
分类:
其他好文 时间:
2015-01-26 10:12:41
阅读次数:
239
1.使用逗号分割金额String.prototype.strReverse = function() { return this.split('').reverse().join('');}function amountSplit(amount) { return amount.toSt...
分类:
编程语言 时间:
2015-01-25 17:54:28
阅读次数:
142
Evaluate the value of an arithmetic expression inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an integer or another express...
分类:
其他好文 时间:
2015-01-25 07:37:13
阅读次数:
169
一、 题目
这道题给出一个数列,求大于这个数列的最小数列。
例如:
1,2,3 → 1,3,2
3,2,1 → 1,2,3
1,1,5 → 1,5,1
二、 分析
喜欢使用C++的童鞋或许会马上想到next_permutation()这个库函数,没错,其实这道题就是实现的它(严格说来只是初步实现),如果可以的话,如果直接输入这一行代码就可通过:
void...
分类:
其他好文 时间:
2015-01-25 01:26:02
阅读次数:
208
首先,演示一个错误的reverList 1 class Solution { 2 public: 3 ListNode* reverse(ListNode* root) 4 { 5 if(NULL == root) 6 ...
分类:
其他好文 时间:
2015-01-24 20:00:01
阅读次数:
131
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it ...
分类:
编程语言 时间:
2015-01-24 08:57:54
阅读次数:
148
题目You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a singl...
分类:
其他好文 时间:
2015-01-23 21:26:02
阅读次数:
205
1 伸缩流方向:flex-direction属性名称:flex-direction取值:row | row-reverse | column | column-reverse初始值:row应用于:伸缩容器媒体:视觉计算值:指定的值2 伸缩行换行:flex-wrap属性名称:flex-wrap取值:n...
分类:
Web程序 时间:
2015-01-23 19:42:20
阅读次数:
186
DescriptionIgnatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you should reverse all the words an...
分类:
其他好文 时间:
2015-01-23 13:10:17
阅读次数:
115
题目描述:Add Two NumbersYou are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nod...
分类:
其他好文 时间:
2015-01-23 10:52:22
阅读次数:
133