作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 日期 题目地址:https://leetcode.com/problems/binary-string-with-substrings-representing-1-to-n/ 题目描述 Given a binary string S (a string consisting only of '0' and '1's) and a positive…
题目如下: Given a binary string S (a string consisting only of '0' and '1's) and a positive integer N, return true if and only if for every integer X from 1 to N, the binary representation of X is a substring of S. Example 1: Input: S = "0110", N =…
[LeetCode]481. Magical String 解题报告(Python) 标签(空格分隔): LeetCode 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/magical-string/description/ 题目描述: A magical string S consists of only '1' and '2' and obeys the f…
[LeetCode]880. Decoded String at Index 解题报告(Python) 标签(空格分隔): LeetCode 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/decoded-string-at-index/description/ 题目描述: An encoded string S is given. To find and wri…
[LeetCode]199. Binary Tree Right Side View 解题报告(Python) 标签: LeetCode 题目地址:https://leetcode.com/problems/binary-tree-right-side-view/description/ 题目描述: Given a binary tree, imagine yourself standing on the right side of it, return the values of the no…
Difficulty: Hard  More:[目录]LeetCode Java实现 Description https://leetcode.com/problems/binary-tree-postorder-traversal/ Given a binary tree, return the postordertraversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [3,2,1] Foll…
链接:https://leetcode.com/tag/binary-search-tree/ [220]Contains Duplicate III (2019年4月20日) (好题) Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[i] and nums[…
[Question] Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". [My Solution] Slice 切片 class Solution(object): def reverseString(self, s): """ :type s…
https://leetcode.com/problems/binary-string-with-substrings-representing-1-to-n/ Given a binary string S (a string consisting only of '0' and '1's) and a positive integer N, return true if and only if for every integer X from 1 to N, the binary repre…
[题目] 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 nodes with keys less than the node's key. The right subtree of a node contains only nodes with…