Given a string s consists of upper/lower-case alphabets and empty space characters '
', return the length of last word in the string.
If the last word does not exist, return 0.
Note: A word is...
分类:
其他好文 时间:
2015-05-06 23:05:47
阅读次数:
196
function trim(str){ //创建空格对象 var space = new String(" "); /* str = trimLeft(str,space); str = trimRight(str,space); */ return tri...
分类:
Web程序 时间:
2015-05-06 21:08:25
阅读次数:
242
经常见到这种排版,父级的css 有relative,而子级的css含有absolute,这样,子级宽度自适应的话是不会超过父级的宽度.解决办法有两种:1.给子级设置宽度.2.给子级设置css属性 white-space:nowrap;
分类:
其他好文 时间:
2015-05-06 21:05:18
阅读次数:
715
https://leetcode.com/problems/word-break/Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence o...
分类:
其他好文 时间:
2015-05-06 19:36:19
阅读次数:
204
在div中,文本布局经常出现,换行混乱的情况。问题表现:1.如果是全英文字符串,中间不包含任何符号(包括空格),不自动换行. 2.中英文混写,则在英文字符串的开始处换行(英文长度>div长度),结尾处不换行。 3.英文整个单词换行。等等,可能还有一些问题,这里只列出了常见的几个;介绍上面几个css属...
分类:
其他好文 时间:
2015-05-06 17:30:43
阅读次数:
110
最小生成树,用了Kruskal算法。POJ上C++能过,G++不能过。。。 算出每两个圆心之间的距离,如果距离小于两半径之和,那么这两个圆心之间的距离直接等于0,否则等于距离-R[i]-R[j]。#include#include#include#includeusing namespace std;...
分类:
其他好文 时间:
2015-05-06 17:18:04
阅读次数:
99
问题描述:Given a linked list, swap every two adjacent nodes and return its head.For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. You...
分类:
其他好文 时间:
2015-05-06 15:07:39
阅读次数:
139
【题目】 Determine whether an integer is a palindrome. Do this without extra space.
click to show spoilers.
Some hints:
Could negative integers be palindromes? (ie, -1)
If you are thinking of co...
分类:
其他好文 时间:
2015-05-06 13:26:23
阅读次数:
115
weblogic会莫名的宕机,宕机日志跟以往的不同:
Caused By: java.lang.VirtualMachineError: out of space in CodeCache for adapters
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.j...
分类:
Web程序 时间:
2015-05-06 11:03:09
阅读次数:
128
https://leetcode.com/problems/length-of-last-word/Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the leng...
分类:
其他好文 时间:
2015-05-06 01:14:51
阅读次数:
152