题目 Write a function to find the longest common prefix string amongst an array of strings.代码public class Solution {
public String longestCommonPrefix(String[] strs) {
if(strs.length==0) ...
分类:
其他好文 时间:
2015-02-08 16:53:08
阅读次数:
164
学习Unity的可能多数是C#转过来的, 一进来的时候你会发现Unity编写代码,在一些视频或文章中.基本都没有用过get/set使用, 多数是public string name;这样写的公开字段,可能在设计的时候视图上设置字段无法与get/set联动起来(只是一种猜测) [SerializeF....
分类:
编程语言 时间:
2015-02-08 16:48:35
阅读次数:
203
UVA - 455Periodic StringsTime Limit:3000MSMemory Limit:Unknown64bit IO Format:%lld & %lluSubmitStatusDescriptionPeriodic StringsA character string is ...
分类:
其他好文 时间:
2015-02-08 16:37:44
阅读次数:
185
首先注意到此题具有递归解,处理到第i个数字的时候,有两种情况:
1, s[i]是单独的一个字母
2, s[i]与s[i - 1]合并成一个合法的字母(在0和26之间)
在第i位的decode ways是两者之和
res[i] = s[i] != '0' ? res[i - 1] : 0 + isValid(s[i], s[i - 1]) ? res[i - 2] : 0;
...
分类:
其他好文 时间:
2015-02-08 15:31:06
阅读次数:
181
package com;
import java.text.SimpleDateFormat;
public class Date {
public static void main(String[] args) {
// TODO Auto-generated method stub
//使用Date得需要设置格式
SimpleDateFormat tim...
分类:
编程语言 时间:
2015-02-08 14:07:15
阅读次数:
227
若存在特殊字符用此方法,效率高,若不存在就用replacepublic static String repStr(String str) { if(str == null) { return null; } char[] array = str.toCharArray(); fo...
分类:
其他好文 时间:
2015-02-08 14:02:32
阅读次数:
134
今天开始看项目二:画幅好画
项目中会用到图形生成包ReportLab,因此首先装好这个包:easy_install reportlab
从书中可以了解到,这个包主要用于作图。
比如说写字、画线等。执行代码:
from reportlab.lib import colors
from reportlab.graphics.shapes import Drawing,String,PolyLi...
分类:
编程语言 时间:
2015-02-08 12:57:05
阅读次数:
179
Given a string containing just the characters '(', ')', '{', '}', '[' and ']',
determine if the input string is valid.
The brackets must close in the correct order, "()" and "()[]{}" are
all va...
分类:
其他好文 时间:
2015-02-08 12:55:47
阅读次数:
153
题目描述:Write a function to find the longest common prefix string amongst an array of strings. 题目很唬人,搞清楚前缀的意思就简单了。解题思路就四个字:垂直匹配。solution:string longestC....
分类:
其他好文 时间:
2015-02-08 12:43:29
阅读次数:
152
新建一个Android项目sns。
在String.xml添加文字
resources>
string
name="app_name">Sns发送短信string>
string
name="hello">Hello World, MainActivity!string>
string
name="number">输入手机号string>
strin...
分类:
移动开发 时间:
2015-02-08 10:22:14
阅读次数:
233