题意:这个题意理解比较重要,题目的意思就是指找到一个字符串数组中由相同字符构成的字符串组
思路:基本思路是这样的,建立一个string - > list 的hash表, key是字符串的字符按序排列的字符串,然后遍历list的size即可
代码:
public List anagrams(String[] strs) {
List rs = new LinkedLis...
分类:
其他好文 时间:
2015-05-16 16:37:33
阅读次数:
136
You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation
of each word in wordsexactly once and w...
分类:
其他好文 时间:
2015-05-16 16:32:19
阅读次数:
89
1 可以用一个数组字面量来初始化一个数组,简单地把一个或多个值放在一起就可以了。数组字面量的写法是一行用逗号隔开的值,并在行的两端用一对方括号包起来: 2 [value 1, value 2, value 3] 3 4 下面的例子创建了一个存放String类型值,名为shoppingLi...
分类:
编程语言 时间:
2015-05-16 16:16:20
阅读次数:
162
写一个能处理字符串的类。
#include
#include
using namespace std;
class String
{
public:
String( ); //默认构造函数
String(const char *s);
String(String &str); //构造函数
...
分类:
其他好文 时间:
2015-05-16 14:56:18
阅读次数:
128
1 为了构造一个很长的字符串,可以创建一个空字符串作为初始值。可以将空的字符串字面量赋值给变量,也可以初始化一个新的String 实例: 2 var emptyString = "" // 空字符串字面量 3 var anotherEmptyString = Strin...
分类:
编程语言 时间:
2015-05-16 14:46:05
阅读次数:
282
如果提示缺少结束符,可以试着把字符串中德回车给去掉。如果其实缺少‘}’,可以用"替代‘string content = string.Format(@"设备类型:{0}   设备编号:{1}设备位置:{2}工作状态:{3}   健康状态:{4}设备信息>>  主要监...
分类:
其他好文 时间:
2015-05-16 14:44:26
阅读次数:
356
题意:有n个点需要探索(编号从1到n),然后给出图上有那些有向边,问最少选择多少个点能遍历所有的点。注意走过的点可以重复再走。
题解:二分图求最小路径覆盖问题中点是不可以重复的,但这道题说可以重复,所以做法是可以把走过的点跳过,间接相连的点改为直接相连就可以跳过了。
特殊样例
5 4
1 2
2 3
4 2
2 5#include
#include <string....
分类:
其他好文 时间:
2015-05-16 13:28:15
阅读次数:
129
对于任务系统来说,最重要的就是处理脚本之间的消息传递,所以任务系统的核心必定就是事件委托了。这里给出核心代码:
using UnityEngine;
using System.Collections;
public class TaskCondition
{
public string id;//条件id
public int nowAmount;//条件id的当前进度
...
分类:
编程语言 时间:
2015-05-16 13:28:01
阅读次数:
615
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication20{ public interface IFiler { string doF...
分类:
其他好文 时间:
2015-05-16 13:22:53
阅读次数:
103
执行不带输出参数的存储过程与 执行普通update sql没有什么区别,直接调用即可:示例代码:public Boolean startResidentialInfoStatistics(String residentialID) { Boolean exeflag=false; String .....
分类:
数据库 时间:
2015-05-16 13:20:17
阅读次数:
365