上一页 1 ··· 7 8 9 10 11 12 13 14 15 下一页
摘要: LeetCode 405. Convert a Number to Hexadecimal 简单题,只为记录一下整数转十六进制的几种写法。 题目描述 Given an integer, write an algorithm to convert it to hexadecimal. For nega 阅读全文
posted @ 2021-02-02 11:57 与MPI做斗争 阅读(47) 评论(0) 推荐(0) 编辑
摘要: 题目描述 LeetCode 三道 Path Sum 的题目,给定一棵二叉树和一个路径和targetSum,分别求问: LeetCode 112. Path Sum 满足条件的从root到leaf的路径是否存在; LeetCode 113. Path Sum II 满足条件的从root到leaf的路径 阅读全文
posted @ 2021-01-31 13:31 与MPI做斗争 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 组合数计算 计算组合数的题目及其变体还是比较常见的,这里记录一下几种经典解法。 我们以一个典型问题为例进行讨论: LeetCode 62. Unique Paths,问的是 mxn 的矩阵从左上走到右下有几种走法,每次只能向下走或者向右走。 动态规划 第一种解法是DP,采用递推公式 \(C(m, n 阅读全文
posted @ 2021-01-30 00:49 与MPI做斗争 阅读(234) 评论(0) 推荐(0) 编辑
摘要: Ubuntu 18.04 LTS 启用 WakeOnLAN 本文记录局域网内,网络唤醒主机的办法,需要BIOS开启WOL支持。 1. 本机安装ethtool sudo apt install ethtool -y 2. 查看本机MAC地址 ifconfig -a 本机网卡名为eno1,有的名叫eth 阅读全文
posted @ 2021-01-23 22:16 与MPI做斗争 阅读(1217) 评论(0) 推荐(0) 编辑
摘要: LeetCode 315. 计算右侧小于当前元素的个数 You are given an integer array nums and you have to return a new counts array. The counts array has the property where cou 阅读全文
posted @ 2021-01-23 20:18 与MPI做斗争 阅读(93) 评论(0) 推荐(0) 编辑
摘要: LeetCode 201. Bitwise AND of Numbers Range 题目描述 Given a range [m, n] where 0 ⇐ m ⇐ n ⇐ 2147483647, return the bitwise AND of all numbers in this range 阅读全文
posted @ 2021-01-23 16:01 与MPI做斗争 阅读(75) 评论(0) 推荐(0) 编辑
摘要: LeetCode 162. Find Peak Element 题目描述 A peak element is an element that is strictly greater than its neighbors. Given an integer array nums, find a pea 阅读全文
posted @ 2021-01-22 20:40 与MPI做斗争 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 旋转数组查找元素 一共四道旋转数组查找元素的题目: 无重复数组查找指定元素, 有重复数组查找指定元素, 无重复数组查找最小元素, 有重复数组查找最小元素。 LeetCode 33. Search in Rotated Sorted Array 题目描述 You are given an intege 阅读全文
posted @ 2021-01-21 22:25 与MPI做斗争 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 在做一道简单题的时候,遇到了一个奇怪的问题。 LeetCode 532. K-diff Pairs in an Array 题目描述 Given an array of integers nums and an integer k, return the number of unique k-dif 阅读全文
posted @ 2021-01-16 21:05 与MPI做斗争 阅读(108) 评论(0) 推荐(0) 编辑
摘要: LintCode 386. 最多有k个不同字符的最长子字符串 题目描述 给定字符串S,找到最多有k个不同字符的最长子串T。 样例 样例 1: 输入: S = "eceba" 并且 k = 3 输出: 4 解释: T = "eceb" 样例 2: 输入: S = "WORLD" 并且 k = 4 输出 阅读全文
posted @ 2021-01-16 19:31 与MPI做斗争 阅读(79) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 下一页