leetcode.com 2026-02-07
🟡1653.minimum-deletions-to-make-string-balanced
🏷️ Tags
#stack #string #dynamic_programming
🟡1653.minimum-deletions-to-make-string-balanced
🏷️ Tags
#stack #string #dynamic_programming
Telegraph
minimum-deletions-to-make-string-balanced
You are given a string s consisting only of characters 'a' and 'b'. You can delete any number of characters in s to make s balanced. s is balanced if there is no pair of indices (i,j) such that i < j and s[i] = 'b' and s[j]= 'a'. Return the minimum number…
leetcode.cn 2026-06-14
🟡2130.maximum-twin-sum-of-a-linked-list
🏷️ Tags
#stack #linked_list #two_pointers
🟡2130.maximum-twin-sum-of-a-linked-list
🏷️ Tags
#stack #linked_list #two_pointers
Telegraph
maximum-twin-sum-of-a-linked-list
在一个大小为 n 且 n 为 偶数 的链表中,对于 0 <= i <= (n / 2) - 1 的 i ,第 i 个节点(下标从 0 开始)的孪生节点为第 (n-1-i) 个节点 。
leetcode.com 2026-06-14
🟡2130.maximum-twin-sum-of-a-linked-list
🏷️ Tags
#stack #linked_list #two_pointers
🟡2130.maximum-twin-sum-of-a-linked-list
🏷️ Tags
#stack #linked_list #two_pointers
Telegraph
maximum-twin-sum-of-a-linked-list
In a linked list of size n, where n is even, the ith node (0-indexed) of the linked list is known as the twin of the (n-1-i)th node, if 0 <= i <= (n / 2) - 1.
leetcode.cn 2026-07-19
🟡1081.smallest-subsequence-of-distinct-characters
🏷️ Tags
#stack #greedy #string #monotonic_stack
🟡1081.smallest-subsequence-of-distinct-characters
🏷️ Tags
#stack #greedy #string #monotonic_stack
Telegraph
smallest-subsequence-of-distinct-characters
返回 s 字典序最小的子序列,该子序列包含 s 的所有不同字符,且只包含一次。 示例 1: 输入:s = "bcabc" 输出:"abc" 示例 2: 输入:s = "cbacdcbc" 输出:"acdb" 提示:
leetcode.com 2026-07-19
🟡1081.smallest-subsequence-of-distinct-characters
🏷️ Tags
#stack #greedy #string #monotonic_stack
🟡1081.smallest-subsequence-of-distinct-characters
🏷️ Tags
#stack #greedy #string #monotonic_stack
Telegraph
smallest-subsequence-of-distinct-characters
Given a string s, return the lexicographically smallest subsequence of s that contains all the distinct characters of s exactly once. Example 1: Input: s = "bcabc" Output: "abc" Example 2: Input: s = "cbacdcbc" Output: "acdb" Constraints: