摘要: 题目:Given a string containing only digits, restore it by returning all possible valid IP address combinations.For example:Given"25525511135",return["25... 阅读全文
posted @ 2015-04-09 12:06 GoNuts 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 题目: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a sin... 阅读全文
posted @ 2015-04-09 02:19 GoNuts 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 题目: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stoppin... 阅读全文
posted @ 2015-04-06 00:51 GoNuts 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 这题第一眼看到想到的是BFS。接着想到我需要一个queue来做BFS。之后,为了能一一对应的复制,还用到一个Map。对应新旧node。BUG: 就是我在复制新child node之前,就把旧child node添加到新的node的neighbors中了。 1 public Undirecte... 阅读全文
posted @ 2015-04-04 12:34 GoNuts 阅读(111) 评论(0) 推荐(0) 编辑