上一页 1 ··· 5 6 7 8 9 10 11 12 13 下一页
  2023年1月31日
摘要: 给定两个大小分别为 m 和 n 的正序(从小到大)数组 nums1 和 nums2。请你找出并返回这两个正序数组的 中位数 。 算法的时间复杂度应该为 O(log (m+n)) 。 示例 1: 输入:nums1 = [1,3], nums2 = [2] 输出:2.00000 解释:合并数组 = [1 阅读全文
posted @ 2023-01-31 20:42 Coder何 阅读(34) 评论(0) 推荐(0)
  2023年1月13日
摘要: 给你一个整数数组 nums ,请你找出一个具有最大和的连续子数组(子数组最少包含一个元素),返回其最大和。 子数组 是数组中的一个连续部分。 示例 1: 输入:nums = [-2,1,-3,4,-1,2,1,-5,4] 输出:6 解释:连续子数组 [4,-1,2,1] 的和最大,为 6 。 示例 阅读全文
posted @ 2023-01-13 19:30 Coder何 阅读(29) 评论(0) 推荐(0)
摘要: 给定两个字符串 text1 和 text2,返回这两个字符串的最长 公共子序列 的长度。如果不存在 公共子序列 ,返回 0 。 一个字符串的 子序列 是指这样一个新的字符串:它是由原字符串在不改变字符的相对顺序的情况下删除某些字符(也可以不删除任何字符)后组成的新字符串。 例如,"ace" 是 "a 阅读全文
posted @ 2023-01-13 14:56 Coder何 阅读(35) 评论(0) 推荐(0)
  2023年1月11日
摘要: 给定一个长度为 n 的整数数组 height 。有 n 条垂线,第 i 条线的两个端点是 (i, 0) 和 (i, height[i]) 。 找出其中的两条线,使得它们与 x 轴共同构成的容器可以容纳最多的水。 返回容器可以储存的最大水量。 说明:你不能倾斜容器。 示例 1: 输入:[1,8,6,2 阅读全文
posted @ 2023-01-11 23:35 Coder何 阅读(73) 评论(0) 推荐(0)
摘要: 按照国际象棋的规则,皇后可以攻击与之处在同一行或同一列或同一斜线上的棋子。 n 皇后问题 研究的是如何将 n 个皇后放置在 n×n 的棋盘上,并且使皇后彼此之间不能相互攻击。 给你一个整数 n ,返回所有不同的 n 皇后问题 的解决方案。 每一种解法包含一个不同的 n 皇后问题 的棋子放置方案,该方 阅读全文
posted @ 2023-01-11 17:10 Coder何 阅读(86) 评论(0) 推荐(0)
  2023年1月8日
摘要: Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to ou 阅读全文
posted @ 2023-01-08 15:53 Coder何 阅读(35) 评论(0) 推荐(0)
  2023年1月7日
摘要: Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the c 阅读全文
posted @ 2023-01-07 20:24 Coder何 阅读(25) 评论(0) 推荐(0)
  2022年11月1日
摘要: A long-distance telephone company charges its customers by the following rules: Making a long-distance call costs a certain amount per minute, dependi 阅读全文
posted @ 2022-11-01 01:13 Coder何 阅读(33) 评论(0) 推荐(0)
  2022年10月31日
摘要: It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that c 阅读全文
posted @ 2022-10-31 23:49 Coder何 阅读(35) 评论(0) 推荐(0)
  2022年10月24日
摘要: 题目描述 If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123*105 阅读全文
posted @ 2022-10-24 02:07 Coder何 阅读(23) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 下一页