From 9d30fc897c781890973c27924ab48186683c7ebc Mon Sep 17 00:00:00 2001 From: Vombit Date: Sat, 23 May 2026 20:29:33 +0500 Subject: [PATCH] 1 --- solutions/lc1725.py | 5 +++++ solutions/lc1748.py | 14 ++++++++++++++ solutions/lc1768.py | 16 ++++++++++++++++ solutions/lc1967.py | 8 ++++++++ solutions/lc2678.py | 8 ++++++++ solutions/lc2960.py | 9 +++++++++ 6 files changed, 60 insertions(+) create mode 100644 solutions/lc1725.py create mode 100644 solutions/lc1748.py create mode 100644 solutions/lc1768.py create mode 100644 solutions/lc1967.py create mode 100644 solutions/lc2678.py create mode 100644 solutions/lc2960.py diff --git a/solutions/lc1725.py b/solutions/lc1725.py new file mode 100644 index 0000000..36165a2 --- /dev/null +++ b/solutions/lc1725.py @@ -0,0 +1,5 @@ +class Solution: + def countGoodRectangles(self, rectangles: List[List[int]]) -> int: + sqrs = [min(i) for i in rectangles] + + return sqrs.count(max(sqrs)) \ No newline at end of file diff --git a/solutions/lc1748.py b/solutions/lc1748.py new file mode 100644 index 0000000..0a9a203 --- /dev/null +++ b/solutions/lc1748.py @@ -0,0 +1,14 @@ +class Solution: + def sumOfUnique(self, nums: List[int]) -> int: + set_nums = set() + set_second = set() + + for i in nums: + if i in set_nums: + set_nums.remove(i) + set_second.add(i) + else: + if i not in set_second: + set_nums.add(i) + + return sum(set_nums) \ No newline at end of file diff --git a/solutions/lc1768.py b/solutions/lc1768.py new file mode 100644 index 0000000..6dc2046 --- /dev/null +++ b/solutions/lc1768.py @@ -0,0 +1,16 @@ +class Solution: + def mergeAlternately(self, word1: str, word2: str) -> str: + word3 = "" + j = i = 0 + len1 = len(word1) + len2 = len(word2) + while j < len1 or i < len2: + if j < len1: + word3 += "".join(word1[j]) + j += 1 + + if i < len2: + word3 += "".join(word2[i]) + i += 1 + + return word3 \ No newline at end of file diff --git a/solutions/lc1967.py b/solutions/lc1967.py new file mode 100644 index 0000000..6c1e1b1 --- /dev/null +++ b/solutions/lc1967.py @@ -0,0 +1,8 @@ +class Solution: + def numOfStrings(self, patterns: List[str], word: str) -> int: + r = 0 + for i in patterns: + if i in word: + r += 1 + + return r \ No newline at end of file diff --git a/solutions/lc2678.py b/solutions/lc2678.py new file mode 100644 index 0000000..8e0c0c3 --- /dev/null +++ b/solutions/lc2678.py @@ -0,0 +1,8 @@ +class Solution: + def countSeniors(self, details: List[str]) -> int: + total = 0 + for i in details: + if int(i[11:13]) > 60: + total += 1 + + return total \ No newline at end of file diff --git a/solutions/lc2960.py b/solutions/lc2960.py new file mode 100644 index 0000000..6ceb2eb --- /dev/null +++ b/solutions/lc2960.py @@ -0,0 +1,9 @@ +class Solution: + def countTestedDevices(self, batteryPercentages: List[int]) -> int: + total = 0 + + for i in batteryPercentages: + if i-total > 0: + total += 1 + + return total \ No newline at end of file