2015年11月10日
摘要: 题目:Given an array containingndistinct numbers taken from0, 1, 2, ..., n, find the one that is missing from the array.For example,Givennums=[0, 1, 3]re... 阅读全文
posted @ 2015-11-10 10:47 已停更 阅读(162) 评论(0) 推荐(0)
  2015年11月9日
摘要: 题目:Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].N... 阅读全文
posted @ 2015-11-09 15:27 已停更 阅读(162) 评论(0) 推荐(0)
  2015年11月6日
摘要: 题目:Given a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,2,3].... 阅读全文
posted @ 2015-11-06 09:50 已停更 阅读(222) 评论(0) 推荐(0)
  2015年11月5日
摘要: 题目:Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the ... 阅读全文
posted @ 2015-11-05 21:32 已停更 阅读(183) 评论(0) 推荐(0)
摘要: 题目:Given two stringssandt, write a function to determine iftis an anagram ofs.For example,s= "anagram",t= "nagaram", return true.s= "rat",t= "car", re... 阅读全文
posted @ 2015-11-05 15:16 已停更 阅读(183) 评论(0) 推荐(0)
摘要: 题目:Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For example, the 32-bit... 阅读全文
posted @ 2015-11-05 14:23 已停更 阅读(229) 评论(0) 推荐(0)
摘要: 题目:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on Wikipedi... 阅读全文
posted @ 2015-11-05 09:04 已停更 阅读(186) 评论(0) 推荐(0)
  2015年11月4日
摘要: 题目:Related to questionExcel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: ... 阅读全文
posted @ 2015-11-04 20:50 已停更 阅读(217) 评论(0) 推荐(0)
摘要: 题目:Given an array ofnintegers wheren> 1,nums, return an arrayoutputsuch thatoutput[i]is equal to the product of all the elements ofnumsexceptnums[i].S... 阅读全文
posted @ 2015-11-04 14:34 已停更 阅读(184) 评论(0) 推荐(0)
摘要: 题目:Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the ... 阅读全文
posted @ 2015-11-04 09:52 已停更 阅读(187) 评论(0) 推荐(0)