02 2018 档案

摘要:You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai 阅读全文

posted @ 2018-02-21 12:50 codingEskimo 阅读(134) 评论(0) 推荐(0)

摘要:思路: 这道题因为只有一对,所以可以用hashmap,需要注意的是,数字可能有重复, eg.[1,2,2,3,4] target = 4. 所以最好的办法就是把剩下的放进去。 这样如果有重复,没关系,把现在的index和已经放进去的index返回即可。 阅读全文

posted @ 2018-02-21 11:44 codingEskimo 阅读(98) 评论(0) 推荐(0)

摘要:Write a program to swap odd and even bits in an integer with as few instructions as possible (e.g., bit 0 and bit 1 are swapped, bit 2 and bit 3 are s 阅读全文

posted @ 2018-02-14 11:48 codingEskimo 阅读(165) 评论(0) 推荐(0)

摘要:There is a building of n floors. If an egg drops from the k th floor or above, it will break. If it's dropped from any floor below, it will not break. 阅读全文

posted @ 2018-02-02 12:35 codingEskimo 阅读(409) 评论(0) 推荐(0)

摘要:A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but i 阅读全文

posted @ 2018-02-02 12:08 codingEskimo 阅读(268) 评论(0) 推荐(0)

摘要:Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim 阅读全文

posted @ 2018-02-01 12:29 codingEskimo 阅读(112) 评论(0) 推荐(0)

摘要:Given a knight in a chessboard n * m (a binary matrix with 0 as empty and 1 as barrier). the knight initialze position is (0, 0) and he wants to reach 阅读全文

posted @ 2018-02-01 11:54 codingEskimo 阅读(350) 评论(0) 推荐(0)

摘要:76. Longest Increasing Subsequence 116. Jump Game 603. Largest Divisible Subset 611. Knight Shortest Path 630. Knight Shortest Path II 116. Jump Game 阅读全文

posted @ 2018-02-01 11:44 codingEskimo 阅读(119) 评论(0) 推荐(0)

导航