随笔分类 - LeetCode
摘要:LeetCode:贪婪算法 贪婪算法基础 我 717. 1-bit and 2-bit Characters
阅读全文
摘要:LeetCode:二叉树相关应用 基础知识 617.归并两个二叉树 题目 Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees
阅读全文
摘要:LeetCode:用HashMap解决问题 Find Anagram Mappings 思考:用字典来解决问题,巧妙将数组编号转换为页码,然后快速查表! 771.Jewels and Stones
阅读全文
摘要:LeetCode:位运算实现加法 写在前面 位运算符 实现加法的思路 两个加数,比如5(101)和6(110),如何不用加法就能得出两者之和呢? 我们知道二进制计算中,如果使用异或将会产生无进位的两者之和,而两数相与将会产生进位值!!! 可这样又如何呢? 两者继续异或将会产生 结果就出现了,此时无进
阅读全文
摘要:LeetCode_Easy_471:Number Complement 题目描述 Given a positive integer, output its complement number. The complement strategy is to flip the bits of its bi
阅读全文
摘要:LeetCode:三数之和【15】 题目描述 给定一个包含 n 个整数的数组 nums,判断 nums 中是否存在三个元素 a,b,c ,使得 a + b + c = 0 ?找出所有满足条件且不重复的三元组。 注意:答案中不可以包含重复的三元组。 例如, 给定数组 nums = [-1, 0, 1,
阅读全文
摘要:LeetCode:Maximum Depth of Binary Tree 【问题再现】 Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest p
阅读全文
摘要:LeetCode:Find the Difference 【问题再现】 Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling strin
阅读全文
摘要:LeetCode:Move Zeroes 【问题再现】 Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zer
阅读全文

浙公网安备 33010602011771号