摘要: Given an n x n binary matrix image, flip the image horizontally, then invert it, and return the resulting image. To flip an image horizontally means t 阅读全文
posted @ 2021-04-15 10:49 Makerr 阅读(46) 评论(0) 推荐(0) 编辑
摘要: You are given coordinates, a string that represents the coordinates of a square of the chessboard. Below is a chessboard for your reference. Return tr 阅读全文
posted @ 2021-04-14 09:22 Makerr 阅读(44) 评论(0) 推荐(0) 编辑
摘要: A sentence is a list of words that are separated by a single space with no leading or trailing spaces. Each of the words consists of only uppercase an 阅读全文
posted @ 2021-04-14 08:49 Makerr 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 给你一个单链表的引用结点 head。链表中每个结点的值不是 0 就是 1。已知此链表是一个整数数字的二进制表示形式。 请你返回该链表所表示数字的 十进制值 。 示例 输入:head = [1,0,1]输出:5解释:二进制数 (101) 转化为十进制数 (5) 方法一:二进制转换成十进制(res初值为 阅读全文
posted @ 2020-01-26 11:40 Makerr 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 给你一棵二叉树,请你返回层数最深的叶子节点的和。 示例: 输入:root = [1,2,3,4,5,null,6,7,null,null,null,null,8]输出:15 来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/deepest-leav 阅读全文
posted @ 2020-01-09 10:34 Makerr 阅读(218) 评论(0) 推荐(0) 编辑
摘要: C++中容器queue的使用 front(),back()访问队首队尾元素;pop(),push()出队和入队 题目: 给定一个二叉树,返回其按层次遍历的节点值。 (即逐层地,从左到右访问所有节点)。 例如:给定二叉树: [3,9,20,null,null,15,7], 3 / \ 9 20 / \ 阅读全文
posted @ 2020-01-08 18:54 Makerr 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 题目描述:给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。 你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素。 来源:力扣(LeetCode)链接:https://leetcode-cn.com/ 阅读全文
posted @ 2020-01-05 16:29 Makerr 阅读(122) 评论(0) 推荐(0) 编辑