摘要: Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same. If possible, output 阅读全文
posted @ 2021-03-29 06:23 北叶青藤 阅读(55) 评论(0) 推荐(0) 编辑
摘要: Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array. Follow up:  阅读全文
posted @ 2021-03-29 06:09 北叶青藤 阅读(58) 评论(0) 推荐(0) 编辑
摘要: Given a binary search tree, return a balanced binary search tree with the same node values. A binary search tree is balanced if and only if the depth 阅读全文
posted @ 2021-03-29 05:43 北叶青藤 阅读(42) 评论(0) 推荐(0) 编辑
摘要: Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get. 阅读全文
posted @ 2021-03-29 05:18 北叶青藤 阅读(28) 评论(0) 推荐(0) 编辑
摘要: Given a string S of '(' and ')' parentheses, we add the minimum number of parentheses ( '(' or ')', and in any positions ) so that the resulting paren 阅读全文
posted @ 2021-03-29 05:13 北叶青藤 阅读(37) 评论(0) 推荐(0) 编辑
摘要: Given a robot cleaner in a room modeled as a grid. Each cell in the grid can be empty or blocked. The robot cleaner with 4 given APIs can move forward 阅读全文
posted @ 2021-03-29 04:32 北叶青藤 阅读(53) 评论(0) 推荐(0) 编辑
摘要: Given an integer array nums which is sorted in ascending order and all of its elements are unique and given also an integer k, return the kth missing 阅读全文
posted @ 2021-03-29 02:33 北叶青藤 阅读(52) 评论(0) 推荐(0) 编辑
摘要: You need to construct a binary tree from a string consisting of parenthesis and integers. The whole input represents a binary tree. It contains an int 阅读全文
posted @ 2021-03-29 01:11 北叶青藤 阅读(25) 评论(0) 推荐(0) 编辑
摘要: Given the root of a binary tree, determine if it is a complete binary tree. In a complete binary tree, every level, except possibly the last, is compl 阅读全文
posted @ 2021-03-29 01:08 北叶青藤 阅读(37) 评论(0) 推荐(0) 编辑