摘要: Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Example 2: Note: Try to come up as many solutions as you 阅读全文
posted @ 2015-02-24 15:13 Grandyang 阅读(32793) 评论(15) 推荐(2) 编辑
摘要: Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. Example 1: Input: s1 = "aabcc", s2 = "dbbca", s3 = "aadbbcbcac" Output: 阅读全文
posted @ 2015-02-24 14:03 Grandyang 阅读(17664) 评论(14) 推荐(3) 编辑
摘要: Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only 阅读全文
posted @ 2015-02-24 02:26 Grandyang 阅读(34872) 评论(17) 推荐(2) 编辑
Fork me on GitHub