2013年9月24日

[leetcode.com]算法题目 - Sort Colors

摘要: Given an array withnobjects 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.Note:You are not suppose to use the l 阅读全文

posted @ 2013-09-24 21:32 Horstxu 阅读(423) 评论(0) 推荐(0)

[leetcode.com]算法题目 - Restore IP Addresses

摘要: Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"25525511135",return["255.255.11.135", "255.255.111.35"]. (Order does not matter)我的答案如下: 1 class Solution { 2 public: 3 4 vector restoreIpAddresses 阅读全文

posted @ 2013-09-24 00:01 Horstxu 阅读(514) 评论(0) 推荐(0)

导航