摘要:
将相同字符统计出个数放在字符后,原地修改 解题思路:双指针做法,read和write指针 1 class Solution { 2 public int compress(char[] chars) { 3 int write=0;//写指针 4 int anchor=0;//指向连续字符的第一个 阅读全文
摘要:
递归解法: /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode() {} * TreeNode(int 阅读全文
摘要:
利用库函数,string.split(char ch),以ch为分割符,将字符串分割后存入string数组 再利用split将i去除掉 1 class Solution { 2 public String complexNumberMultiply(String a, String b) { 3 S 阅读全文