Determine whether an integer is a palindrome. Do this without extra space.因为都额外空间有限制所以不能把他先转成字符串然后用两个指针扫了。负数不算回文数是因为前面多了个负号么=_= 这样的话我只能想到一个办法,就是反转一个数字...
分类:
其他好文 时间:
2014-11-23 11:38:33
阅读次数:
176
Problem StatementGiven a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindr...
分类:
其他好文 时间:
2014-11-22 13:20:44
阅读次数:
301
题意:
n(10^5)个字符 光标停在第pos个字符上 光标可以左右任意移动 而且可以从最左移到最右也可以从最右移到最左 在光标处的字符可以按字母顺序或倒序更改 更改也可以a->z或者z->a 光标移动和字符更改都需要1s 问最短几s能把串变成回文的
思路:
最后的状态是一定的 因此更改的次数和策略无关 扫一遍就可以知道更改最少需要几s
光标移动需要一定的策略 容易想到...
分类:
其他好文 时间:
2014-11-21 21:56:23
阅读次数:
246
题目:给定一个链表和一个数x,将链表中比x小的放在前面,其他的放在后头。例如:Given1->4->3->2->5->2andx= 3,return1->2->2->4->3->5.思路:1. 再用两个node,一个指向所有小于x的,一个指向其他的,之后把两个接在一起。接在一起需要注意large是否...
分类:
其他好文 时间:
2014-11-21 14:12:20
阅读次数:
159
静态分区表:一级分区表:CREATE TABLE order_created_partition ( orderNumber STRING , event_time STRING)PARTITIONED BY (event_month string)ROW FORMAT DELIMITED...
分类:
其他好文 时间:
2014-11-20 18:21:25
阅读次数:
343
mac环境下制作windows系统U盘启动盘下载系统文件ylmf.iso转换为img文件hdiutilconvert/Users/os/Downloads/ylmf.iso-formatUDRW-o/Users/os/Downloads/ylmf.img3.卸载U盘diskutillist/dev/disk0#:TYPENAMESIZEIDENTIFIER0:GUID_partition_scheme*251.0GBdisk01:EFIEFI209.7MBdi..
Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the origi...
分类:
其他好文 时间:
2014-11-19 20:32:41
阅读次数:
129
查询各部门中薪水分布处于25%、50%、75%位置的人的薪水,percent_rank()是确定排行中的相对位置。
SQL> select e.ename,e.sal,e.deptno,
percent_rank() over(partition by deptno order by sal desc) p_rank,
PERCENTILE_CONT(0) w...
分类:
数据库 时间:
2014-11-19 18:48:04
阅读次数:
595
uav 11258 String Partition (DP) —— black的专栏—— waShaXiu...
分类:
其他好文 时间:
2014-11-19 11:03:45
阅读次数:
186
Cheapest Palindrome
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 6013
Accepted: 2933
Description
Keeping track of all the cows can be a tricky task so...
分类:
其他好文 时间:
2014-11-19 11:01:46
阅读次数:
183