Given two binary strings, return their sum (also a binary string). The input strings are both non-empty and contains only characters 1 or 0. Example 1 ...
分类:
其他好文 时间:
2018-05-28 22:43:42
阅读次数:
177
一、res目录: 1、属性:Android必需; 2、作用:存放Android项目的各种资源文件。这些资源会自动生成R.java。 2.1、layout:存放界面布局文件。 2.2、strings.xml:字符串资源文件; 2.3、colors.xml:颜色资源文件; 2.4、dimens.xml: ...
分类:
移动开发 时间:
2018-05-26 18:52:11
阅读次数:
236
标签: 字符串hash 题目链接 https://codeforces.com/contest/985/problem/F 题意 首先定义两个长度相等字符串a,b同构,当且仅当a中的每个字母,b中只存在一个字母与之对应,并且两个字母出现位置要完全一致,a,b反过来也要满足。 给定一个长度为$2 \t ...
分类:
其他好文 时间:
2018-05-26 13:57:55
阅读次数:
178
解答 此题个人有思路,但无从下手,是参考他人解法后从而解出来的。 参考链接:https://leetcode.com/problems/subdomain visit count/discuss/129879/C++ O(sum of lengths of strings) simple Solut ...
分类:
其他好文 时间:
2018-05-25 00:21:07
阅读次数:
251
问题 A: Anagram 题目描述 Orz has two strings of the same length: A and B. Now she wants to transform A into an anagram of B (which means, a rearrangement of ...
分类:
其他好文 时间:
2018-05-24 01:09:41
阅读次数:
255
利用字符和数字间的转换,用i来进行单次检验,由于i是动态变化的,所以只有两个同形字符串能够通过检测。 ...
分类:
其他好文 时间:
2018-05-23 11:55:38
阅读次数:
99
import ( "errors" // "fmt" "os" "os/exec" "path/filepath" "runtime" "strings" ) func GetCurrentPath() (string, error) { file, err := exec.LookPath(os.... ...
分类:
其他好文 时间:
2018-05-23 11:50:38
阅读次数:
242
题意:取出字符串Str里的两个串S,T,问对应位置的的字符在否有一一映射关系。 hash:对于每个字符s=‘a’-‘z’,我们任意找一个i,满足Si==s,(代码里用lower_bound在区间找到最小的位置i)其对应的字符为Ti==t。然后我们判断这段区间里s的hash值是否等于t的hash值。不 ...
分类:
其他好文 时间:
2018-05-22 22:17:01
阅读次数:
264
假如两个区间的26的字母出现的位置集合分别是 A1,B1,A2,B2,....., 我们再能找到一个排列p[] 使得 A[i] = B[p[i]] ,那么就可以成功映射了。 显然集合可以直接hash,排序一下hash值就可以判断是否匹配了。。。。 虽然不知道为什么要卡19260817,但反正我是坚决 ...
分类:
其他好文 时间:
2018-05-22 14:54:15
阅读次数:
261