大意: 给定两个串$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
为什么说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
题目地址:https://leetcode-cn.com/problems/greatest-common-divisor-of-strings/ 思路:辗转相除法 代码: 收获: ...
分类:
编程语言 时间:
2019-10-25 15:01:35
阅读次数:
138
Redis不是简单的键值存储,它实际上是一个数据结构服务器,支持不同类型的值。 以下是Redis支持的所有数据结构的列表: Binary-safe strings. Lists: 根据插入顺序排序的字符串元素的集合。它们基本上是链表。 Sets: 唯一,未排序的字符串元素的集合。 Sorted se ...
分类:
其他好文 时间:
2019-10-25 13:14:11
阅读次数:
87