题目:Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s.
解题思路:
回文划分,题目意思是给一个字符串,找出将字符串划分为一系列回文子串的各种可能组合。例如,一个子串“aab“,你需要返回["aa","b"],["a","a","b"]。这个题目的解法也是非常的典型---循环加递归,...
分类:
其他好文 时间:
2014-06-09 23:24:11
阅读次数:
256
package com.hao947;
import java.util.Scanner;
public class demo5 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int x = 0;
x = scanner.nextInt();
Syste...
分类:
编程语言 时间:
2014-06-08 17:25:54
阅读次数:
291
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without
repeating letters for "abcabcbb" is "abc", which the length is 3. Fo...
分类:
其他好文 时间:
2014-06-08 16:27:47
阅读次数:
231
在前几个章节中使用了Comparable作为比较函数。比如对于字符串,就是按字母表的顺序进行排序。有时候想要换一种比较方式,该怎么实现呢?
在Java中可以使用Comparator比较器,以下代码展示了字符串之间不同的比较方式。
String[] a;
...
Arrays.sort();
...
Arrays.sort(a, String.CASE_INSENSITI...
分类:
其他好文 时间:
2014-06-08 15:37:08
阅读次数:
201
题目
A message containing letters from A-Z is being encoded to numbers using
the following mapping:
'A' -> 1
'B' -> 2
...
'Z' -> 26
Given an encoded message containing digits, determine ...
分类:
其他好文 时间:
2014-06-08 15:30:08
阅读次数:
182
WebClient web = new CookieWebClient();
web.Encoding = Encoding.UTF8;
string regUrl = "http://test.com";
web.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
byte[] post = Encoding.UTF...
分类:
Web程序 时间:
2014-06-08 10:50:57
阅读次数:
324
题目
Given a string containing only digits, restore it by returning all possible valid IP address combinations.
For example:
Given "25525511135",
return ["255.255.11.135", "255.255.111.3...
分类:
其他好文 时间:
2014-06-08 10:37:47
阅读次数:
273
//读取报告数据
string data=null;
using (System.IO.StreamReader sr = new System.IO.StreamReader(filePath, System.Text.Encoding.Default))
{
...
分类:
其他好文 时间:
2014-06-08 08:27:59
阅读次数:
236
在iOS中可变字典增加一个键值对的方法有setObject: forKey:
和setValue : forKey:
.为了方便我们把这两个方法简称为方法A和方法B。B这个方法中其中的value值是不能为nil,否则程序会出项崩溃。而A方法中的这个value可以为nil,但是当这个value位nil...
分类:
其他好文 时间:
2014-06-07 21:24:08
阅读次数:
241
问题: ASP.NET Configuration
site->安全,报错“选定的数据存储区出现问题,原因可能是服务器名称或凭据无效,或者权限不足”解决:打开文件C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config找到...
分类:
其他好文 时间:
2014-06-07 21:14:32
阅读次数:
279