Given an array of strings, return all groups of strings that are anagrams.
Note: All inputs will be in lower-case.
题意:给你string的数组,让你求出字符和个数都相同的字符串。
思路:对于每个字符串都排序后,用map标记是否已经加入到答案中。
class Solutio...
分类:
其他好文 时间:
2015-03-08 18:51:47
阅读次数:
120
第一章:1.C#学习,分三部分:net farmeword, C#基础语法,studion工具2.Main()方法与java一样,都是程序的入口Main()方法有四种类型,参数可选,返回值可以是void和intstatic void Mian(String[] args){}static int M...
public class TestJVM { // 运行时数据区【方法区、堆、程序计数器、虚拟机栈、本地方法栈】 private static int _1M = 1024 * 1024; public static void main(String[] args) { by...
分类:
其他好文 时间:
2015-03-08 18:32:26
阅读次数:
134
本文来自转载一、窗口常用方法 1.Frame():构造方法,无标题,默认布局为BorderLayout。 2.Frame(String s):构造方法,窗口标题为s,默认布局为BorderLayout。 3.public void setBounds(int a,int b,int width...
分类:
编程语言 时间:
2015-03-08 18:31:19
阅读次数:
187
input1 格式: input([prompt]) prompt为提示信息 ctrl+z结束输入2 函数功能: 接受一个标准输入数据,返回string类型3 实例: print1 格式: print([object, ...], *, sep=' ', end='\n', file=sys...
分类:
编程语言 时间:
2015-03-08 18:29:08
阅读次数:
229
用两个关键字记录,分别为屌丝时间和女神时间
若屌丝约,更新屌丝时间
若女神约,更新屌丝和女神时间
学习,则两个全部清空
#include "stdio.h"
#include "string.h"
struct Data
{
int l,r,x1,x2,l1,l2,r1,r2;
}data[400010];
int Max(int a,int b)
{
if...
分类:
其他好文 时间:
2015-03-08 17:14:18
阅读次数:
147
Java中String是一个特殊的包装类数据有两种创建形式:String s = "abc";String s = new String("abc"); 第一种先在栈中创建一个对String类的对象引用变量s,然后去查找"abc"是否被保存在字符串常量池中,如果没有则在栈中创建三个char型的值'a...
分类:
编程语言 时间:
2015-03-08 17:10:35
阅读次数:
173
我们都知道可以用已下方式来初始化string对象:
string s(“hello world!”);
实际上我们也可以通过这样的方式来实现:
char c[] = {‘h’,‘e’,‘l’,‘l’,‘o’,‘ ‘,‘w’,‘o’,‘r’,‘l’,‘d’,‘!’,‘\0’};
string s = c;
但是如果数组c不是以空字符结尾的话,那么上面的赋值就是不正确的。
实际...
分类:
其他好文 时间:
2015-03-08 15:48:05
阅读次数:
127
Substring
Given
a set of pattern strings, and a text, you have to find, if any of the pattern is a substring of the text. If any of the pattern string can be found in text, then print “yes”, othe...
分类:
其他好文 时间:
2015-03-08 15:45:57
阅读次数:
225
这题是道水题,用数学方法做比较简单。因为在做二分法的专题,所以这里采用二分的方式做,很简单,但是还是要用到数学的知识,比如三角形相似,圆台的体积公式等。#include"iostream"#include"stdio.h"#include"algorithm"#include"string.h"#i...
分类:
其他好文 时间:
2015-03-08 15:39:42
阅读次数:
110