摘要: Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word does not exist, return 0. Note: A word is defined as a character sequence consists of non-space characters only. 阅读全文
posted @ 2014-06-21 17:49 般若一号 阅读(498) 评论(0) 推荐(0) 编辑
摘要: Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue. Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue respectively. 阅读全文
posted @ 2014-06-21 11:00 般若一号 阅读(347) 评论(0) 推荐(0) 编辑