" F. Equalizing Two Strings " 有几种情况可以直接判定结果: ① 字母对应个数不一样,可直接判NO ② 当不满足①时,如果有一个字母有2个及以上的个数,也可直接判YES ③ 当不满足①②时我们可以知道,此时的字符串最多也只有26个字符,所以可以直接暴力,一个字符串只交换相 ...
分类:
其他好文 时间:
2019-11-07 19:24:10
阅读次数:
109
大意: 给定两个串$s,t$, 每次操作任选长度$len$, 分别翻转$s,t$中一个长$len$的子串, 可以进行任意次操作, 求判断能否使$s$和$t$相同. 字符出现次数不一样显然无解, 否则若某种字符出现多次, 显然有解, 否则只要逆序对奇偶性相同就有解, 不同则无解. #include < ...
分类:
其他好文 时间:
2019-11-06 22:49:23
阅读次数:
95
0.字符串为不可变类型,内部使用指针指向UTF-8字节数组 不过要修改字符串可以先将其转换成[]byte或者[]rune。如下 输出: aBcd 电话 for遍历字符串有byte和rune两种方式,见代码 输出 一些常用接口 1.判断是不是以某个字符串开头 输出 源码片段 2.判断是不是以某个字符串 ...
分类:
编程语言 时间:
2019-11-02 09:45:05
阅读次数:
96
同构图形,是指将两个或两个以上的图形通过图形设计的组合、嫁接等处理手段组合在一起,共同构成一个新图形,并且要传达出一个新的意义。这个新图形并不是原图形的简单相加,而是一种图形意义的超越或突变,从而形成强烈的视觉冲击力。 1、 中文名:同构图形外文名:isomorphic image释 义:两个或两个 ...
分类:
其他好文 时间:
2019-11-01 18:41:45
阅读次数:
400
为什么说strings.Reader类型的值可以高效地读取字符串 与strings.Builder类型恰恰相反,strings.Reader类型是为了高效读取字符串而存在的。后者的高效主要体现在它对字符串的读取机制上,它封装了很多用于在string值上读取内容的最佳实践。 strings.Reade ...
分类:
其他好文 时间:
2019-11-01 09:43:53
阅读次数:
155
A. CME Description Solution B. Strings Equalization Description Solution C. Save the Nature Description 给出一个长为n序列A,A[i]=x表示第i次卖出的物品的价值为x,你可以任意交换其中的值。 ...
分类:
其他好文 时间:
2019-10-29 21:24:45
阅读次数:
81
Given an array of strings, group anagrams together. Example: Note: All inputs will be in lowercase. The order of your output does not matter. 基本的遍历练手题 ...
分类:
其他好文 时间:
2019-10-27 23:15:32
阅读次数:
163
Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concate ...
分类:
其他好文 时间:
2019-10-27 23:13:50
阅读次数:
187
"Group Anagrams" Given an array of strings, group anagrams together. Example: Note: All inputs will be in lowercase. The order of your output does not ...
分类:
其他好文 时间:
2019-10-27 20:18:35
阅读次数:
91
1、Find memory used by an object 2、Combine a list of strings into a single string 3、Find elements that exist in either of the two lists 4、Track frequen ...
分类:
编程语言 时间:
2019-10-27 16:39:49
阅读次数:
93