随笔分类 - LeetCode
摘要:https://leetcode-cn.com/problems/robot-return-to-origin/ 设置 flagUD 记录机器人相对于原点在纵向上的最终位置 flagRL 记录机器人相对于原点在横向上的最终位置 如果最终 flagUD==0 && flagRL==0 ,说明机器人的最
阅读全文
摘要:https://leetcode-cn.com/problems/delete-node-in-a-linked-list/ 非常巧妙的一道题。 题目没有给head,心想没有head我怎么才能找到要删除的值对应的节点呢? 仔细一看,题中函数的参数给的不是值,而是要删除的节点node。反而降低了解题难
阅读全文
摘要:https://leetcode-cn.com/problems/range-sum-of-bst/ 二叉树中序遍历 二叉搜索树性质:一个节点大于所有其左子树的节点,小于其所有右子树的节点
阅读全文
摘要:https://leetcode-cn.com/problems/max-increase-to-keep-city-skyline/ 执行用时 : 3 ms, 在Max Increase to Keep City Skyline的Java提交中击败了95.31% 的用户 内存消耗 : 37.7 M
阅读全文
摘要:https://leetcode-cn.com/problems/remove-outermost-parentheses/ Java Solution
阅读全文
摘要:Reverse String 题目要求: Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". 题目大意:
阅读全文
摘要:Nim Game 题目描述: 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 rem
阅读全文
摘要:Add Digits 题目描述: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit.For example:Given num = 38, the p
阅读全文

浙公网安备 33010602011771号