摘要: 题目 Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is sym 阅读全文
posted @ 2018-10-02 14:47 shinjia 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 题目 Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally id 阅读全文
posted @ 2018-10-02 11:19 shinjia 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 题目 Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: The number of elements initialized in nums1 and 阅读全文
posted @ 2018-10-02 09:11 shinjia 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 题目 Given a sorted linked list, delete all duplicates such that each element appear only once. Example 1: Input: 1 1 2 Output: 1 2 Example 2: Input: 1 阅读全文
posted @ 2018-10-01 11:36 shinjia 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 题目 Given two binary strings, return their sum (also a binary string). The input strings are both non empty and contains only characters 1 or 0. Exampl 阅读全文
posted @ 2018-10-01 11:09 shinjia 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 题目 Given a non empty array of digits representing a non negative integer, plus one to the integer. The digits are stored such that the most significan 阅读全文
posted @ 2018-10-01 11:00 shinjia 阅读(104) 评论(0) 推荐(0) 编辑
摘要: 题目 Given a string s consists of upper/lower case alphabets and empty space characters ' ', return the length of last word in the string. If the last w 阅读全文
posted @ 2018-10-01 09:29 shinjia 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 题目 You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you 阅读全文
posted @ 2018-09-30 11:38 shinjia 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 题目 Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in 阅读全文
posted @ 2018-09-30 09:06 shinjia 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 题目 Given an array nums and a value val, remove all instances of that value in place and return the new length. Do not allocate extra space for another 阅读全文
posted @ 2018-09-29 10:56 shinjia 阅读(91) 评论(0) 推荐(0) 编辑