摘要: s3 是用来存放sort 结果的,整个算法非常像 selection sort/bubble sort 1: 每次从s1中选出最小的一个放在s3 中,其他非最小的放入s2 中 2: 然后把s2 的数字放回到s1 中 循环结束后,s3 中的就是sort 好的结果 阅读全文
posted @ 2018-04-06 07:57 davidnyc 阅读(778) 评论(0) 推荐(0)
摘要: Repeatedly remove all adjacent, repeated characters in a given string from left to right.No adjacent characters should be identified in the final string.Examples"abbbaaccz" → "aaaccz" → "ccz" → "z""aa... 阅读全文
posted @ 2018-04-06 04:51 davidnyc 阅读(465) 评论(0) 推荐(0)
摘要: Determine if a small string is a substring of another large string.Return the index of the first occurrence of the small string in the large string.Return -1 if the small string is not a substring of ... 阅读全文
posted @ 2018-04-06 03:40 davidnyc 阅读(199) 评论(0) 推荐(0)