a few solutions
Game Plan\n\n\uD83D\uDEAB We cannot form a triangle if the sum of the minimum two side lengths is less-than-or-equal-to the maximum side length.\n \'none\'\n\n\
# Game Plan\n\n\uD83D\uDEAB We cannot form a triangle if the sum of the minimum two side lengths is less-than-or-equal-to the maximum side length.\n* `\'none\'`\n\n\u2705 Otherwise we return the type of triangle based on the **cardinality of the set of side lengths:**\n\n1. `\'equilateral\'`\n2. `\'isosceles\'`\n3. `\'scalene\'`\n\n---\n\n*Kotlin*\n```\nclass Solution {\n    var triangleType = { A: IntArray -> if (A.sorted().slice(0..1).sum() <= A.max()!!) "none" else if (1 == A.toSet().size) "equilateral" else if (2 == A.toSet().size) "isosceles" else "scalene" }\n}\n```\n\n*Javascript*\n```\nlet triangleType = A => _.sum(A.sort((a, b) => a - b).slice(0, 2)) <= Math.max(...A) ? \'none\' : 1 == new Set(A).size ? \'equilateral\' : 2 == new Set(A).size ? \'isosceles\' : \'scalene\';\n```\n\n*Python3*\n```\nclass Solution:\n    triangleType = lambda self, A: \'none\' if sum(sorted(A)[:2]) <= max(A) else "equilateral" if len(set(A)) == 1 else "isosceles" if len(set(A)) == 2 else "scalene"\n```\n\n*Rust*\n```\nuse std::collections::HashSet;\nimpl Solution {\n    pub fn triangle_type(mut A: Vec<i32>) -> String {\n        let f = (|s| String::from(s));\n        A.sort();\n        let (lo, hi) = (A[0] + A[1], A[2]);\n        if lo <= hi {\n            return f("none");\n        }\n        let S: HashSet<i32> = A.drain(..).collect();\n        let N = S.len();\n        if N == 1 { f("equilateral") } else if N == 2 { f("isosceles") } else { f("scalene") }\n    }\n}\n```\n\n*C++*\n```\nclass Solution {\npublic:\n    using VI = vector<int>;\n    using Set = unordered_set<int>;\n    string triangleType(VI& A) {\n        sort(A.begin(), A.end());\n        auto [lo, hi] = make_pair(A[0] + A[1], A[2]);\n        if (lo <= hi)\n            return "none";\n        auto N = Set{ A.begin(), A.end() }.size();\n        return N == 1 ? "equilateral" : N == 2 ? "isosceles" : "scalene";\n    }\n};\n```\n\n---\n\n# Supplemental\n\n\uD83D\uDE35 I totally bombed today\'s contest \uD83D\uDC7B\n\n![bi-weekly123.png](https://assets.leetcode.com/users/images/d9da4ae1-41bd-43a6-942a-dab6f7833844_1706976930.752772.png)\n\n\uD83E\uDD2A After TLE via Hidden TC for [Q3](https://leetcode.com/problems/maximum-good-subarray-sum/description/), I went back to [Q2](https://leetcode.com/contest/biweekly-contest-123/problems/find-the-number-of-ways-to-place-people-i/) and ran out of time \u231B\uFE0F\n\n\n## Q3: [3026. Maximum Good Subarray Sum](https://leetcode.com/problems/maximum-good-subarray-sum/description/)\n```\n# track previously seen i-th value and index\n\n# then for each current j-th value index, lookup A[j] - K     <=== was that previously seen?  if so, then consider prefix sums from i..j inclusive for best solution\n\n# class Solution:\n#     def maximumSubarraySum(self, A: List[int], K: int, INF = int(1e123)) -> int:\n#         best = INF\n#         N = len(A)\n#         S = [0] * (N + 1)\n#         for i in reversed(range(N)):\n#             S[i] = S[i + 1] + A[i]\n#         m = defaultdict(set)\n#         for j in range(N):\n#             T = A[j] - K\n#             if T in m:\n#                 for i in m[T]:\n#                     cand = S[j + 1] - S[i]\n#                     best = max(best, cand)\n#             m[A[j]].add(j)\n#         return best if best < INF else 0\n\n# 7:45am - debug code\n\n# [-1,-2,-3,-4], k = 2\n\n# [-10, -9, -7, -4, 0]\n# target: -3\n# not found in m\n# target: -4\n# not found in m\n# target: -5\n# not found in m\n# target: -6\n# not found in m\n# defaultdict(<class \'set\'>, {-1: {0}, -2: {1}, -3: {2}, -4: {3}})\n\n# [-1,3,2,4,5], k = 3\n\n# [13, 14, 11, 9, 5, 0]\n# target: 2\n# not found in m\n# target: 6\n# not found in m\n# target: 5\n# not found in m\n# target: 7\n# not found in m\n# target: 8\n# not found in m\n# defaultdict(<class \'set\'>, {-1: {0}, 3: {1}, 2: {2}, 4: {3}, 5: {4}})\n\n# class Solution:\n#     def maximumSubarraySum(self, A: List[int], K: int, INF = -int(1e123)) -> int:\n#         best = INF\n#         N = len(A)\n#         S = [0] * (N + 1)\n#         for i in reversed(range(N)):\n#             S[i] = S[i + 1] + A[i]\n#         print(S)\n#         m = defaultdict(set)\n#         for j in range(N):\n#             T = A[j] + (-K if 0 <= A[j] else K)\n#             print(f\'target: {T}\')\n#             if T in m:\n#                 print(\'found in m ok\')\n#                 for i in m[T]:\n#                     cand = S[i] - S[j + 1]\n#                     print(f\'cand: {cand}  best: {best}\')\n#                     best = max(best, cand)\n#             else:\n#                 print(\'not found in m\')\n#             m[A[j]].add(j)\n#         print(m)\n#         print()\n#         print()\n#         return best if best != INF else 0\n\n# Submission Result: Wrong Answer \n# Input:\n# [1,4,3]\n# 1\n# Output:\n# 0\n# Expected:\n# 7\n\n# [1,4,3]\n# 1\n# Your stdout\n# [8, 7, 3, 0]\n# target: 0\n# not found in m\n# target: 3\n# not found in m\n# target: 2\n# not found in m\n# defaultdict(<class \'set\'>, {1: {0}, 4: {1}, 3: {2}})\n\n# Submission Result: Time Limit Exceeded \n# Last executed input:\n# Hidden for this testcase during contest.\n\n# class Solution:\n#     def maximumSubarraySum(self, A: List[int], K: int, INF = -int(1e123)) -> int:\n#         best = INF\n#         N = len(A)\n#         S = [0] * (N + 1)\n#         for i in reversed(range(N)):\n#             S[i] = S[i + 1] + A[i]\n#         m = defaultdict(set)\n#         for j in range(N):\n#             for offset in [-K, K]:\n#                 T = A[j] + offset\n#                 if T in m:\n#                     for i in m[T]:\n#                         cand = S[i] - S[j + 1]\n#                         best = max(best, cand)\n#             m[A[j]].add(j)\n#         return best if best != INF else 0\n    \n# Submission Result: Time Limit Exceeded \n# Last executed input:\n# Hidden for this testcase during contest.\n\n# class Solution:\n#     def maximumSubarraySum(self, A: List[int], K: int, INF = -int(1e123)) -> int:\n#         best = INF\n#         N = len(A)\n#         S = [0] * (N + 1)\n#         for i in reversed(range(N)):\n#             S[i] = S[i + 1] + A[i]\n#         m = defaultdict(set)\n#         for j in range(N):\n#             for offset in [-K, K]:\n#                 T = A[j] + offset\n#                 if T in m:\n#                     for i in m[T]:\n#                         cand = S[i] - S[j + 1]\n#                         best = max(best, cand)\n#             m[A[j]].add(j)\n#         return best if best != INF else 0\n```\n\n## Q2: [3025. Find the Number of Ways to Place People I](https://leetcode.com/problems/find-the-number-of-ways-to-place-people-i/description/)\n```\n# just a linear scan of sorted values?\n\n# so we can have "buckets" per x-coordinate which have sorted y-coordinate\n\n# use rule-of-product?  we just need counts per bucket\n\n# Submission Result: Wrong Answer \n# Input:\n# [[0,0],[0,3]]\n# Output:\n# 0\n# Expected:\n# 1\n\n# we are looking for all current x bucket values which are less-than-or-equal-to the lowest previoux x bucket value\n\n# [[1,1],[2,2],[3,3]]\n# pre: -1  last: 1234567890\n# y: 1  in cur: 1\n# pre: 1  last: 1\n# y: 2  in cur: 2\n# last: 1 <= y: 2\n# pre: 2  last: 2\n# y: 3  in cur: 3\n# last: 2 <= y: 3\n\n\n# [[6,2],[4,4],[2,6]]\n\n# 2,6\n# 4,4\n\n# pre: -1  last: 1234567890\n# y: 6  in cur: 2\n# pre: 2  last: 6\n# y: 4  in cur: 4\n# pre: 4  last: 4\n# y: 2  in cur: 6\n\n# from sortedcontainers import SortedList\n# class Solution:\n#     def numberOfPairs(self, A: List[List[int]], t = 0, pre = -1) -> int:\n#         m = defaultdict(SortedList)\n#         for x, y in A:\n#             m[x].add(y)\n#         for cur in sorted(m.keys()):\n#             same = len(m[cur])\n#             t += same - 1  # corner case for same bucket\n#             last = m[pre][-1] if pre in m else -1234567890\n#             print(f\'pre: {pre}  last: {last}\')\n#             for y in m[cur]:\n#                 print(f\'y: {y}  in cur: {cur}\')\n#                 if y <= last:\n#                     print(f\'y: {y} <= last: {last}\')\n#                     t += 1\n#             pre = cur\n#         print()\n#         print()\n#         print()\n#         return t\n\n# Submission Result: Wrong Answer \n# Input:\n# [[0,1],[1,3],[6,1]]\n# Output:\n# 1\n# Expected:\n# 2\n\n# from sortedcontainers import SortedList\n# class Solution:\n#     def numberOfPairs(self, A: List[List[int]], t = 0, pre = -1) -> int:\n#         m = defaultdict(SortedList)\n#         for x, y in A:\n#             m[x].add(y)\n#         for cur in sorted(m.keys()):\n#             same = len(m[cur])\n#             t += same - 1  # corner case for same bucket\n#             last = m[pre][-1] if pre in m else -1234567890\n#             for y in m[cur]:\n#                 if y <= last:\n#                     t += 1\n#             pre = cur\n#         return t\n\n# Submission Result: Wrong Answer \n# Input:\n# [[0,5],[4,4],[1,6]]\n# Output:\n# 1\n# Expected:\n# 2\n\n# from sortedcontainers import SortedList\n# class Solution:\n#     def numberOfPairs(self, A: List[List[int]], t = 0, pre = -1) -> int:\n#         m = defaultdict(SortedList)\n#         rows = Counter()\n#         for x, y in A:\n#             m[x].add(y)\n#             rows[y] += 1\n#         for cur in sorted(m.keys()):\n#             same = len(m[cur])\n#             t += same - 1  # corner case for same bucket\n#             last = m[pre][0] if pre in m else -1234567890\n#             for y in m[cur]:\n#                 if y < last:\n#                     t += 1\n#             pre = cur\n#         for cnt in rows.values():\n#             t += cnt - 1\n#         return t\n\n# count of bottom-most previous-bucket values above top-most current-bucket values (inclusive)\n\n# [[6,2],[4,4],[2,6]]\n\nfrom sortedcontainers import SortedList\nclass Solution:\n    def numberOfPairs(self, A: List[List[int]], t = 0, pre = -1, INF = 1234567890) -> int:\n        m = defaultdict(SortedList)\n        for x, y in A:\n            m[x].add(y)\n        seen = []\n        for cur in sorted(m.keys()):\n            if pre in m:\n                bottom = m[pre][0]\n                top = m[cur][-1]\n                print(f\'bottom: {bottom}  top: {top}\')\n                i = bisect_left(seen, top)\n                print(f\'seen: {seen}  t: {t}  +=  len(seen): {len(seen)} - i: {i} = {len(seen) - i}\')\n                print()\n                t += len(seen) - i\n            seen.append(m[cur][0])  # bottom of current\n            pre = cur\n        return t\n\n# class Solution:\n#     def numberOfPairs(self, A: List[List[int]], t = 0, pre = -1) -> int:\n#         m = defaultdict(list)\n#         for x, y in A:\n#             m[x].append(y)\n#         for x in m.keys():\n#             m[x].sort()\n#         for cur in sorted(m.keys()):\n#             last = m[pre][-1]\n#             for x in m[cur]:\n#                 if last <= x:\n#                     t += 1\n#             pre = cur\n#         return t\n```
['C++', 'Python3', 'Rust', 'Kotlin', 'JavaScript']