随笔分类 -  leetcode

刷leetcode的记录及总结
摘要:Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical a 阅读全文
posted @ 2016-02-27 00:40 torrescx 阅读(175) 评论(0) 推荐(0)
摘要:Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements 阅读全文
posted @ 2016-02-24 11:13 torrescx 阅读(149) 评论(0) 推荐(0)
摘要:Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, giv 阅读全文
posted @ 2016-02-23 01:49 torrescx 阅读(248) 评论(0) 推荐(0)
摘要:Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is like: 阅读全文
posted @ 2016-02-21 22:55 torrescx 阅读(202) 评论(0) 推荐(0)
摘要:Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear runtime complex 阅读全文
posted @ 2016-02-20 20:57 torrescx 阅读(519) 评论(0) 推荐(0)
摘要:You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 ston 阅读全文
posted @ 2016-02-19 22:17 torrescx 阅读(562) 评论(0) 推荐(0)