随笔分类 -  leetcode

1 2 3 4 5 ··· 19 下一页

【leetcode_easy_math】892. Surface Area of 3D Shapes
摘要:problem 892. Surface Area of 3D Shapes solution#1: code 注意,不是简单的投影面积的2倍; 参考 1. leetcode_easy_math_892. Surface Area of 3D Shapes; 2. Grandyang; 完 阅读全文

posted @ 2021-04-28 15:40 鹅要长大 阅读(35) 评论(0) 推荐(0) 编辑

【leetcode_easy】1636. Sort Array by Increasing Frequency
摘要:problem 1636. Sort Array by Increasing Frequency solution#1: sort code 注意: 1. sort的用法,特别是第三个参数的使用; 2. lamda函数; 参考 1. leetcode_easy_array_1636. Sort Ar 阅读全文

posted @ 2021-04-27 23:57 鹅要长大 阅读(87) 评论(0) 推荐(0) 编辑

【leetcode_easy】1640. Check Array Formation Through Concatenation
摘要:problem 1640. Check Array Formation Through Concatenation solution#1: code 参考 1. leetcode_easy_array_1640. Check Array Formation Through Concatenation 阅读全文

posted @ 2021-04-27 23:55 鹅要长大 阅读(27) 评论(0) 推荐(0) 编辑

【leetcode_easy_math】942. DI String Match
摘要:problem 942. DI String Match solution#1: code 参考 1. leetcode_easy_math_942. DI String Match; 2. Grandyang; 完 阅读全文

posted @ 2021-04-27 23:54 鹅要长大 阅读(34) 评论(0) 推荐(0) 编辑

【leetcode_easy_math】1281. Subtract the Product and Sum of Digits of an Integer
摘要:problem 1281. Subtract the Product and Sum of Digits of an Integer solution#1: code 参考 1. leetcode_easy_math_1281. Subtract the Product and Sum of Dig 阅读全文

posted @ 2021-04-27 14:15 鹅要长大 阅读(23) 评论(0) 推荐(0) 编辑

【leetcode_easy_math】1237. Find Positive Integer Solution for a Given Equation
摘要:problem 1237. Find Positive Integer Solution for a Given Equation solution#1: two loop; code solution#2: binary search; code 参考 1. leetcode_easy_math_ 阅读全文

posted @ 2021-04-27 10:57 鹅要长大 阅读(50) 评论(0) 推荐(0) 编辑

【leetcode_easy_math】1317. Convert Integer to the Sum of Two No-Zero Integers
摘要:problem 1317. Convert Integer to the Sum of Two No-Zero Integers solution#1:检查数值中是否含有字符0; code: solution#2: 通过判断除以10的余数来判断是否含有符号0; code: 注意,理解题目的意思,要求 阅读全文

posted @ 2021-04-27 09:36 鹅要长大 阅读(22) 评论(0) 推荐(0) 编辑

【leetcode_easy_math】1175. Prime Arrangements
摘要:problem 1175. Prime Arrangements solution#1: 根据数值的范围直接给出范围内的素数进行计算; code solution#2: 求解素数的个数,然后求解素数和非素数的阶乘之积。 code: 注意1,两个int类型的数据相乘之后的数据范围及类型; 注意2,数据 阅读全文

posted @ 2021-04-26 23:22 鹅要长大 阅读(41) 评论(0) 推荐(0) 编辑

【leetcode_easy_math】1523. Count Odd Numbers in an Interval Range
摘要:problem 1523. Count Odd Numbers in an Interval Range solution#1: 分别计算0到low-1和0到high的奇数数目,然后做差即可。 code solution#2:根绝high和low的奇偶性判断。 code 参考 1. leetcode 阅读全文

posted @ 2021-04-26 23:19 鹅要长大 阅读(55) 评论(0) 推荐(0) 编辑

【leetcode_easy_math】1025. Divisor Game
摘要:problem 1025. Divisor Game solution#1: code 参考 1. leetcode_easy_math_1025. Divisor Game; 2. LeetCode.1025-除数游戏(Divisor Game); 3. 1025. 除数博弈(Divisor Ga 阅读全文

posted @ 2021-04-26 23:14 鹅要长大 阅读(61) 评论(0) 推荐(0) 编辑

【leetcode_easy_math】1009. Complement of Base 10 Integer
摘要:problem 1009. Complement of Base 10 Integer solution#1:XOR. code 参考 1. leetcode_easy_math_1009. Complement of Base 10 Integer; 完 阅读全文

posted @ 2021-04-26 23:00 鹅要长大 阅读(43) 评论(0) 推荐(0) 编辑

【leetcode_easy_string】606. Construct String from Binary Tree
摘要:problem 606. Construct String from Binary Tree solution#1: 使用原函数递归; code solution#2: 使用额外函数递归; code 参考 1. leetcode_easy_string_606. Construct String f 阅读全文

posted @ 2021-04-26 21:54 鹅要长大 阅读(55) 评论(0) 推荐(0) 编辑

【leetcode_easy_string】1332. Remove Palindromic Subsequences
摘要:problem 1332. Remove Palindromic Subsequences solution#1:判断是否为回文; code solution#2:在主要函数中直接判断回文; code solution#3:使用string的rbegin/rend特性; code 注意,不明白为什么 阅读全文

posted @ 2021-04-26 21:53 鹅要长大 阅读(12) 评论(0) 推荐(0) 编辑

【leetcode_easy_string】1309. Decrypt String from Alphabet to Integer Mapping
摘要:problem 1309. Decrypt String from Alphabet to Integer Mapping solution#1:将问题分为两部分进行判断; code 参考 1. leetcode_easy_string_1309. Decrypt String from Alpha 阅读全文

posted @ 2021-04-26 21:43 鹅要长大 阅读(14) 评论(0) 推荐(0) 编辑

【leetcode_easy_string】1221. Split a String in Balanced Strings
摘要:problem 1221. Split a String in Balanced Strings solution#1: 括号匹配问题; code 参考 1. leetcode_easy_string_1221. Split a String in Balanced Strings; 2. 【Lee 阅读全文

posted @ 2021-04-26 21:30 鹅要长大 阅读(50) 评论(0) 推荐(0) 编辑

【leetcode_easy_string】1417. Reformat The String
摘要:problem 1417. Reformat The String solution#1: code class Solution { public: string reformat(string s) { string res = ""; string digits = ""; string le 阅读全文

posted @ 2021-04-26 20:55 鹅要长大 阅读(60) 评论(0) 推荐(0) 编辑

【leetcode_easy_string】1374. Generate a String With Characters That Have Odd Counts
摘要:problem 1374. Generate a String With Characters That Have Odd Counts solution#1: code solution#2: one line; code 参考 1. leetcode_easy_string_1374. Gene 阅读全文

posted @ 2021-04-26 20:53 鹅要长大 阅读(49) 评论(0) 推荐(0) 编辑

【leetcode_easy_string】1370. Increasing Decreasing String
摘要:problem 1370. Increasing Decreasing String 理解题意; solution#1: code 参考 1. leetcode_easy_string_1370. Increasing Decreasing String; 完 阅读全文

posted @ 2021-04-26 20:52 鹅要长大 阅读(40) 评论(0) 推荐(0) 编辑

【leetcode_easy_string】1422. Maximum Score After Splitting a String
摘要:problem 1422. Maximum Score After Splitting a String solution#1: code class Solution { public: int maxScore(string s) { int left = 0, right = 0; for(a 阅读全文

posted @ 2021-04-26 20:48 鹅要长大 阅读(20) 评论(0) 推荐(0) 编辑

【leetcode_easy_string】1507. Reformat Date
摘要:problem 1507. Reformat Date solution#1: 使用map;使用函数; code: class Solution { public: unordered_map<string, string> months = {{"Jan", "01"}, {"Feb", "02" 阅读全文

posted @ 2021-02-25 13:38 鹅要长大 阅读(94) 评论(0) 推荐(0) 编辑

1 2 3 4 5 ··· 19 下一页

导航

点击右上角即可分享
微信分享提示