码迷,mamicode.com
首页 >  
搜索关键字:string    ( 95377个结果)
LeetCode – Refresh – Largest Number
Corner case: when all the elements are 0. It should return "0", not "00000000".It use string to compare all the numbers. 1 class Solution { 2 public: ...
分类:其他好文   时间:2015-03-20 06:58:14    阅读次数:109
LeetCode – Refresh – Interleaving String
Notes:1. Even s3 is empty string, if s1 and s2 are emtpy, then it should be true.2. Do not mess up the size of label. 1 class Solution { 2 public: 3 ....
分类:其他好文   时间:2015-03-20 06:54:54    阅读次数:115
LeetCode – Refresh – Integer to Roman
Pretty straight forward. 1 class Solution { 2 public: 3 string getRoman(int n, char ten, char five, char one) { 4 string result; 5 ...
分类:其他好文   时间:2015-03-20 06:53:42    阅读次数:124
Java 接口能不能有具体的实现
publicinterfaceS{}publicinterfaceB{publicstaticfinalSs=newS(){publicStringtoString(){return"我在接口实现了";}publicvoiddoString(Strings){System.out.println("我在接口实现了");}};}publicclassTest{publicstaticvoidmain(String[]args){Strings=B.s.toString();Syste..
分类:编程语言   时间:2015-03-20 01:33:49    阅读次数:154
redis list数据类型
List数据类型List是一个链表结构,主要功能为push,pop,获取一个范围的所有值等等。操作中key理解为链表的名字,redis的list其实就是一个每个子元素都是string类型的双向链表,我们可以通过push,pop操作从链表的头或者尾部添加删除元素,这样list既可以作为栈,又可以作为队列lp..
分类:其他好文   时间:2015-03-20 01:32:56    阅读次数:240
redis string和hash类型操作
Redis的数据类型String类型及操作String是最简单的类型,一个Key对应一个Value,sting类型是二进制安全的。Redis的string可以包含任何数据,比如jpg图片或者序列化的对象。例子:setnamegxjgetname输出:gxjSetnx:设置key对应的值为string类型的value,如果key已经存在,则返..
分类:其他好文   时间:2015-03-20 01:32:17    阅读次数:387
逗号字符串排序
1 public String StrSort(string Str) 2 { 3 var tempOption = Str.TrimEnd(',').Split(','); 4 var text = ""; 5 ...
分类:编程语言   时间:2015-03-20 01:20:04    阅读次数:158
LeetCode – Refresh – Generate Parentheses
Nothing fancy, just use recursive. 1 class Solution { 2 public: 3 void getP(vector &result, string current, int left, int right) { 4 if (l...
分类:其他好文   时间:2015-03-20 01:16:21    阅读次数:113
[LeetCode] Restore IP Addresses 回溯
Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"25525511135",return["255.2...
分类:其他好文   时间:2015-03-20 01:15:53    阅读次数:186
两个超大数相加
解决超大数相加的问题的一种思路是把整形转化成字符串,废话不多说直接上代码,已经调试通过。 #include #include #include using namespace std; string add(string str1, string str2) { int i; string str; int len_str1 = str1.length(); int len_...
分类:其他好文   时间:2015-03-20 00:06:39    阅读次数:247
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!