作者归档:在线疯狂

RSS feed of 在线疯狂

[LeetCode]Lexicographical Numbers

题目描述:

LeetCode 386. Lexicographical Numbers

Given an integer n, return 1 - n in lexicographical order.

For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9].

Please optimize your algorithm to use less time and space. The input size may be as large as ...

继续阅读

[LeetCode]Same Tree

题目描述:

LeetCode 100. Same Tree

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 and the nodes have the same value.

题目大意:

给定两棵二叉树,编写函数检查它们是否相等。 ...

继续阅读

[LeetCode]Ransom Note

题目描述:

LeetCode 383. Ransom Note

Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from the magazines; otherwise, it will ...

继续阅读