
Recursion
flyatcmu
这个作者很懒,什么都没留下…
展开
-
Integer to English Words
Convert a non-negative integernumto its English words representation. Example 1: Input: num = 123 Output: "One Hundred Twenty Three" Example 2: Input: num = 12345 Output: "Twelve Thousand Three Hundred Forty Five" Example 3: Input: num = 12345..原创 2022-01-19 08:08:30 · 320 阅读 · 0 评论 -
Find Kth Bit in Nth Binary String
Given two positive integersnandk,the binary stringSnis formed as follows: S1= "0" Si=Si-1+ "1" + reverse(invert(Si-1))fori > 1 Where+denotes the concatenation operation,reverse(x)returns the reversed stringx,andinvert(x)inverts al...原创 2020-08-09 13:38:57 · 237 阅读 · 0 评论 -
Longest Univalue Path
Given a binary tree, find the length of the longest path where each node in the path has the same value. This path may or may not pass through the root. Note: The length of path between two nodes is ...原创 2018-11-18 14:31:23 · 259 阅读 · 0 评论 -
Search in a Binary Search Tree
Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node's value equals the given value. Return the subtree rooted with that node. If such node...原创 2018-11-25 04:45:57 · 169 阅读 · 0 评论 -
Merge Two Binary Trees
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need to merge them into a new binary tree...原创 2018-12-25 13:14:00 · 136 阅读 · 0 评论