摘要:
Add BinaryGiven two binary strings, return their sum (also a binary string).Examplea = 11b = 1Return 100solution:比较两个string的长度,将长读较小的string左边用0补齐。设置进位... 阅读全文
摘要:
ProblemGiven an input string, reverse the string word by word.For example, Given s = "the sky is blue", return "blue is sky the".ClarificationWhat con... 阅读全文
摘要:
*本文为摘抄笔记*Preface当程序需要对String对象进行许多改变时会用到StringBuilder类。因为字符串和String对象都是不可改变的,而StringBuilder对象则是易变的。String类不可变,就意味着每次对象进行改变时都需要创建一个新的对象副本。如果在创建长的字符串,或者... 阅读全文
摘要:
【Problem】Unique CharactersImplement an algorithm to determine if a string has all unique characters.ExampleGiven "abc", return true.Given "aab", retur... 阅读全文