上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 54 下一页

2020年7月15日

摘要: problem 1295. Find Numbers with Even Number of Digits solution1: 计算数据的位数; code: solution2: 根据数据范围确定数据位数; code: 参考 1. leetcode_1295. Find Numbers with 阅读全文
posted @ 2020-07-15 23:01 鹅要长大 阅读(117) 评论(0) 推荐(0)
摘要: problem 1266. Minimum Time Visiting All Points solution1: Chebyshev Distance. code 参考 1. leetcode_1266. Minimum Time Visiting All Points; 完 阅读全文
posted @ 2020-07-15 23:00 鹅要长大 阅读(109) 评论(0) 推荐(0)
摘要: problem 1260. Shift 2D Grid solution1: 将矩阵看作一维矩阵,然后是数据循环移动; solution2:计算新的数据对应的下标,仍然使用二维矩阵进行移动; code 注意: 1. 数据是如何进行循环移动的; 2. 下标的重新计算; 参考 1. leetcode_1 阅读全文
posted @ 2020-07-15 22:58 鹅要长大 阅读(155) 评论(0) 推荐(0)
摘要: problem 1275. Find Winner on a Tic Tac Toe Game 没看明白什么思路。。。看明白之后,发现最重要的是如何表示和存储每行每列和对角线是否在一条线上的状态。moves表示每一步骤所放置的位置坐标,A先B后; winner的状态共有六种,同一行三种、同一列三种、 阅读全文
posted @ 2020-07-15 22:56 鹅要长大 阅读(118) 评论(0) 推荐(0)
摘要: problem 1450. Number of Students Doing Homework at a Given Time 参考 1. leetcode_1450. Number of Students Doing Homework at a Given Time; 完 阅读全文
posted @ 2020-07-15 22:50 鹅要长大 阅读(91) 评论(0) 推荐(0)
摘要: problem 1287. Element Appearing More Than 25% In Sorted Array solution1: 累计元素数目; code: solution2: 滑窗处理; code: 注意理解题意: 1. 数组是非减数组; 2. 可以计数或者滑窗; 参考 1. l 阅读全文
posted @ 2020-07-15 22:47 鹅要长大 阅读(151) 评论(0) 推荐(0)
摘要: problem 1299. Replace Elements with Greatest Element on Right Side solution1: 使用元素交换; code solution2: 使用最大值求解; code solution3: 使用多目运算; code 注意: 1. 末尾元 阅读全文
posted @ 2020-07-15 22:45 鹅要长大 阅读(124) 评论(0) 推荐(0)
摘要: problem 1512. Number of Good Pairs solution #1: 双层循环; code solution #2: 使用哈希表; code 注意: 1. 没明白哈希表计算res的方法; 参考 1. leetcode_1512. Number of Good Pairs; 阅读全文
posted @ 2020-07-15 22:41 鹅要长大 阅读(127) 评论(0) 推荐(0)
摘要: problem 1252. Cells with Odd Values in a Matrix 参考 1. leetcode_1252. Cells with Odd Values in a Matrix; 完 阅读全文
posted @ 2020-07-15 22:37 鹅要长大 阅读(65) 评论(0) 推荐(0)
摘要: problem 1351. Count Negative Numbers in a Sorted Matrix solution1: two loop from start; code: solution2: two loop from end; code solution3: binary sea 阅读全文
posted @ 2020-07-15 22:32 鹅要长大 阅读(130) 评论(0) 推荐(0)
摘要: problem 1346. Check If N and Its Double Exist solution1: two loop; code solution2:哈希表; code solution3: 使用set类型; code 注意: 1. 倍数可能在后,也可能在前; 2. 熟练掌握map和s 阅读全文
posted @ 2020-07-15 22:31 鹅要长大 阅读(117) 评论(0) 推荐(0)
摘要: problem 1413. Minimum Value to Get Positive Step by Step Sum solution #1: 按步骤一步步计算求解; code: solution #2: 推演数学逻辑; 1. 能够推导求解背后的逻辑过程; 2. 确定最大值还是最小值; 3. 记 阅读全文
posted @ 2020-07-15 22:26 鹅要长大 阅读(101) 评论(0) 推荐(0)
摘要: problem 1217. Play with Chips 参考 1. leetcode_1217. Play with Chips; 完 阅读全文
posted @ 2020-07-15 22:25 鹅要长大 阅读(138) 评论(0) 推荐(0)
摘要: problem 1365. How Many Numbers Are Smaller Than the Current Number 理解清楚题意,以及计算过程; solution1: two vector; code solution2: one vector; code 注意 1. 累加和的计算 阅读全文
posted @ 2020-07-15 22:22 鹅要长大 阅读(100) 评论(0) 推荐(0)
摘要: problem 1380. Lucky Numbers in a Matrix 在矩阵中,如果一个数既是它所在行的最小值,又是它所在列的最大值,则称这个数为幸运数。找到矩阵中所有的幸运数。 Constraints All elements in the matrix are distinct. so 阅读全文
posted @ 2020-07-15 22:09 鹅要长大 阅读(127) 评论(0) 推荐(0)
摘要: problem 1185. Day of the Week 参考 1. leetcode_1185. Day of the Week; 完 阅读全文
posted @ 2020-07-15 22:03 鹅要长大 阅读(201) 评论(0) 推荐(0)
摘要: problem 1394. Find Lucky Integer in an Array solution #1: 使用哈希表; 使用哈希表记录数组元素和freq,然后判断是否相等,且取最大值; 注意 1. 最大值可以由下标一次递减隐性表示; 2. 数值的范围是1-500; 参考 1. leetco 阅读全文
posted @ 2020-07-15 21:57 鹅要长大 阅读(97) 评论(0) 推荐(0)
摘要: problem 1385. Find the Distance Value Between Two Arrays 参考 1. leetcode_1385. Find the Distance Value Between Two Arrays; 完 阅读全文
posted @ 2020-07-15 21:55 鹅要长大 阅读(110) 评论(0) 推荐(0)
摘要: problem 1389. Create Target Array in the Given Order 注意理解题意,博主看完example才明白题意,就是在index处插入nums; solution #1: code 参考 1. leetcode_1389. Create Target Arr 阅读全文
posted @ 2020-07-15 21:39 鹅要长大 阅读(134) 评论(0) 推荐(0)
摘要: problem 1399. Count Largest Group 最开始没明白题意,每个英文都认识,组合到一起就是没看明白题意。。。 solution #1: code 先求解每个元素的数位和,然后再求解数位和相同的元素个数,最后确定的个数最大的group数目; 参考 1. leetcode_13 阅读全文
posted @ 2020-07-15 21:15 鹅要长大 阅读(131) 评论(0) 推荐(0)
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 54 下一页

导航