摘要:
1 #include <cstdio> 2 #include <iostream> 3 using namespace std; 4 int n=0;//n皇后 5 int ans=0;//解个数 6 bool hashTable[20]={false};//列是否被占有 7 bool xy[20] 阅读全文
摘要:
将相同字符统计出个数放在字符后,原地修改 解题思路:双指针做法,read和write指针 1 class Solution { 2 public int compress(char[] chars) { 3 int write=0;//写指针 4 int anchor=0;//指向连续字符的第一个 阅读全文