Add Binary
Given two binary strings, return their sum (also a binary string).
For example,
a = "11"
b = "1"
Return "100".
解题思路:
题意为两个字符串表示的二进制相加,求结果。记住常字符串与字符串变量能够相加,但是字符串不能与数字相加,字符...
分类:
其他好文 时间:
2015-05-04 20:12:43
阅读次数:
149
总共五种数据类型:1、Strings - 字符串127.0.0.1:6379> set name "zhaoja"OK127.0.0.1:6379> get name"zhaoja"2、Hashes - 哈希值3、Lists - 列表Redis的列表是简单的字符串列表,排序插入顺序。可以添加元素到R...
分类:
其他好文 时间:
2015-05-04 19:30:51
阅读次数:
121
题目描述:
Add Binary
Given two binary strings, return their sum (also a binary string).
For example,
a = "11"
b = "1"
Return "100".
解题思路:
求两个二进制组成的数字的和。首先有几种特殊的情况,a、b均为空,a为空、b非空,a非空、b为空;我们...
分类:
其他好文 时间:
2015-05-04 18:13:48
阅读次数:
154
https://leetcode.com/problems/isomorphic-strings/Given two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters...
分类:
其他好文 时间:
2015-05-04 13:30:33
阅读次数:
118
Isomorphic StringsGiven two stringssandt, determine if they are isomorphic.Two strings are isomorphic if the characters inscan be replaced to gett.All...
分类:
其他好文 时间:
2015-05-04 11:38:46
阅读次数:
140
小二好久没有更新博客了,真是罪过,最近在看linux的东西导致进度耽搁了,所以今晚睡觉前怒刷一题!问题描述:Write a function to find the longest common prefix string amongst an array of strings.解题思路:该问题就是...
分类:
编程语言 时间:
2015-05-04 01:12:56
阅读次数:
534
Given two strings s and t, determine if they are isomorphic.
Two strings are isomorphic if the characters in s can be replaced to get t.
All occurrences of a character must be replaced with a...
分类:
其他好文 时间:
2015-05-03 22:08:21
阅读次数:
106
题目大意:有一个字符串,这个字符串由0,1和*组成,*可以变成0也可以变成1,要求变化后的字符串的字符只能是0或者1。
现在给出这个字符串,要求变化后的字符串中不能出现三个连续相同的子串,问最多可以变化成多少个符合规则的串解题思路:因为只有0和1,且只有30位,所以可以用一个正数来表示状态。dfs暴力枚举,边枚举边判断,看当前的是否符合#include
#include<cstri...
分类:
其他好文 时间:
2015-05-03 20:42:10
阅读次数:
137
Given two strings s and
t, determine if they are isomorphic.
Two strings are isomorphic if the characters in
s can be replaced to get t.
All occurrences of a character must be replaced with anoth...
分类:
其他好文 时间:
2015-05-03 14:42:39
阅读次数:
126
CentOS查看已经安装的lib库版本
strings /usr/lib/libstdc++.so.6 | grep GLIBCXX [root@localhost vscode]# strings /usr/lib/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCX...
分类:
其他好文 时间:
2015-05-03 10:42:51
阅读次数:
201