You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[Leetcode-3343](https://leetcode.com/problems/count-number-of-balanced-permutations/)| Count Number Of Balanced Permutations |[c++](./leetcode/3343.count-number-of-balanced-permutations.cpp), [python3](./leetcode/3343.count-number-of-balanced-permutations.py)| Combinatorics | O\(N^3\)| O\(N^3\)| - |
174
-
|[Leetcode-2338](https://leetcode.com/problems/count-the-number-of-ideal-arrays/)| Count The Number Of Ideal Arrays |[c++](./leetcode/2338.count-the-number-of-ideal-arrays.cpp), [python3](./leetcode/2338.count-the-number-of-ideal-arrays.py)| Combinatorics |\-|\-| - |
174
+
|[Leetcode-2338](https://leetcode.com/problems/count-the-number-of-ideal-arrays/)| Count The Number Of Ideal Arrays |[c++](./leetcode/2338.count-the-number-of-ideal-arrays.cpp), [python3](./leetcode/2338.count-the-number-of-ideal-arrays.py)| Combinatorics |O\(NlogN\)|O\(N\)| - |
175
175
|[Leetcode-3272](https://leetcode.com/problems/find-the-count-of-good-integers/)| Find The Count Of Good Integers |[c++](./leetcode/3272.find-the-count-of-good-integers.cpp), [python3](./leetcode/3272.find-the-count-of-good-integers.py)| Combinatorics | O\(10\*\*\(N/2\)\* NlogN\)| O\(10\*\*\(N/2\)\)| - |
176
176
|[Leetcode-1863](https://leetcode.com/problems/sum-of-all-subset-xor-totals/)| Sum Of All Subset Xor Totals |[c++](./leetcode/1863.sum-of-all-subset-xor-totals.cpp), [python3](./leetcode/1863.sum-of-all-subset-xor-totals.py)| Combinatorics | O\(N\)| O\(1\)| - |
|[Leetcode-3343](https://leetcode.com/problems/count-number-of-balanced-permutations/)| Count Number Of Balanced Permutations |[c++](./leetcode/3343.count-number-of-balanced-permutations.cpp), [python3](./leetcode/3343.count-number-of-balanced-permutations.py)| Dynamic Programming | O\(N^3\)| O\(N^3\)| - |
361
-
|[Leetcode-2338](https://leetcode.com/problems/count-the-number-of-ideal-arrays/)| Count The Number Of Ideal Arrays |[c++](./leetcode/2338.count-the-number-of-ideal-arrays.cpp), [python3](./leetcode/2338.count-the-number-of-ideal-arrays.py)| Dynamic Programming |\-|\-| - |
361
+
|[Leetcode-2338](https://leetcode.com/problems/count-the-number-of-ideal-arrays/)| Count The Number Of Ideal Arrays |[c++](./leetcode/2338.count-the-number-of-ideal-arrays.cpp), [python3](./leetcode/2338.count-the-number-of-ideal-arrays.py)| Dynamic Programming |O\(NlogN\)|O\(N\)| - |
362
362
|[Leetcode-2999](https://leetcode.com/problems/count-the-number-of-powerful-integers/)| Count The Number Of Powerful Integers |[c++](./leetcode/2999.count-the-number-of-powerful-integers.cpp), [python3](./leetcode/2999.count-the-number-of-powerful-integers.py)| Dynamic Programming | O\(N\)| O\(N\)| - |
|[Leetcode-2161](https://leetcode.com/problems/partition-array-according-to-given-pivot/)| Partition Array According To Given Pivot |[c++](./leetcode/2161.partition-array-according-to-given-pivot.cpp), [python3](./leetcode/2161.partition-array-according-to-given-pivot.py)| Two Pointers | O\(N\)| O\(N\)| - |
|[Leetcode-19](https://leetcode.com/problems/remove-nth-node-from-end-of-list/)| Remove Nth Node From End Of List |[c++](./leetcode/19.remove-nth-node-from-end-of-list.cpp), [python3](./leetcode/19.remove-nth-node-from-end-of-list.py)| Two Pointers | O\(N\)| O\(1\)| - |
|[Leetcode-42](https://leetcode.com/problems/trapping-rain-water/)| Trapping Rain Water |[c++](./leetcode/42.trapping-rain-water.cpp), [python3](./leetcode/42.trapping-rain-water.py)| Two Pointers | O\(N\)| O\(N\)| - |
881
882
|[Leetcode-167](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/)| Two Sum Ii Input Array Is Sorted |[c++](./leetcode/167.two-sum-ii-input-array-is-sorted.cpp), [python3](./leetcode/167.two-sum-ii-input-array-is-sorted.py)| Two Pointers | O\(N\)| O\(1\)| - |
882
883
|[Leetcode-653](https://leetcode.com/problems/two-sum-iv-input-is-a-bst/)| Two Sum Iv Input Is A Bst |[c++](./leetcode/653.two-sum-iv-input-is-a-bst.cpp), [python3](./leetcode/653.two-sum-iv-input-is-a-bst.py)| Two Pointers | O\(NH\)| O\(H\)| - |
|[Leetcode-680](https://leetcode.com/problems/valid-palindrome-ii/)| Valid Palindrome II |[c++](./leetcode/680.valid-palindrome-ii.cpp), [python3](./leetcode/680.valid-palindrome-ii.py)| Two Pointers | O\(N\)| O\(1\)| - |
884
886
|[Leetcode-1712](https://leetcode.com/problems/ways-to-split-array-into-three-subarrays/)| Ways To Split Array Into Three Subarrays |[c++](./leetcode/1712.ways-to-split-array-into-three-subarrays.cpp), [python3](./leetcode/1712.ways-to-split-array-into-three-subarrays.py)| Two Pointers | O\(N\)| O\(N\)| - |
885
887
|[Lintcode-861](https://www.lintcode.com/problem/k-empty-slots/)| K Empty Slots |[c++](./lintcode/861.k-empty-slots.cpp), [python3](./lintcode/861.k-empty-slots.py)| Two Pointers | O\(N\)| O\(N\)| Leetcode-683 |
|[Leetcode-143](https://leetcode.com/problems/reorder-list/)| Reorder List |[python3](./leetcode/143.reorder-list.py)| Other |\-|\-| - |
1543
1545
|[Leetcode-7](https://leetcode.com/problems/reverse-integer/)| Reverse Integer |[c++](./leetcode/7.reverse-integer.cpp), [python3](./leetcode/7.reverse-integer.py)| Other |\-|\-| - |
1544
1546
|[Leetcode-92](https://leetcode.com/problems/reverse-linked-list-ii/)| Reverse Linked List II |[c++](./leetcode/92.reverse-linked-list-ii.cpp), [python3](./leetcode/92.reverse-linked-list-ii.py)| Other |\-|\-| - |
1545
-
|[Leetcode-344](https://leetcode.com/problems/reverse-string/)| Reverse String |[c++](./leetcode/344.reverse-string.cpp), [python3](./leetcode/344.reverse-string.py)| Other |\-|\-| - |
1546
1547
|[Leetcode-345](https://leetcode.com/problems/reverse-vowels-of-a-string/)| Reverse Vowels Of A String |[c++](./leetcode/345.reverse-vowels-of-a-string.cpp), [python3](./leetcode/345.reverse-vowels-of-a-string.py)| Other |\-|\-| - |
1547
1548
|[Leetcode-657](https://leetcode.com/problems/robot-return-to-origin/)| Robot Return To Origin |[python3](./leetcode/657.robot-return-to-origin.py)| Other |\-|\-| - |
1548
1549
|[Leetcode-61](https://leetcode.com/problems/rotate-list/)| Rotate List |[python3](./leetcode/61.rotate-list.py)| Other |\-|\-| - |
|[Leetcode-170](https://leetcode.com/problems/two-sum-iii-data-structure-design/)| Two Sum Iii Data Structure Design |[c++](./leetcode/170.two-sum-iii-data-structure-design.cpp), [python3](./leetcode/170.two-sum-iii-data-structure-design.py)| Other |\-|\-| - |
1560
1561
|[Leetcode-929](https://leetcode.com/problems/unique-email-addresses/)| Unique Email Addresses |[python3](./leetcode/929.unique-email-addresses.py)| Other |\-|\-| - |
1561
1562
|[Leetcode-393](https://leetcode.com/problems/utf-8-validation/)| Utf 8 Validation |[c++](./leetcode/393.utf-8-validation.cpp), [python3](./leetcode/393.utf-8-validation.py)| Other |\-|\-| - |
1562
-
|[Leetcode-125](https://leetcode.com/problems/valid-palindrome/)| Valid Palindrome |[c++](./leetcode/125.valid-palindrome.cpp), [python3](./leetcode/125.valid-palindrome.py)| Other |\-|\-| - |
1563
1563
|[Leetcode-408](https://leetcode.com/problems/valid-word-abbreviation/)| Valid Word Abbreviation |[c++](./leetcode/408.valid-word-abbreviation.cpp), [python3](./leetcode/408.valid-word-abbreviation.py)| Other |\-|\-| - |
1564
1564
|[Leetcode-286](https://leetcode.com/problems/walls-and-gates/)| Walls And Gates |[c++](./leetcode/286.walls-and-gates.cpp), [python3](./leetcode/286.walls-and-gates.py)| Other |\-|\-| - |
1565
1565
|[Leetcode-127](https://leetcode.com/problems/word-ladder/)| Word Ladder |[c++](./leetcode/127.word-ladder.cpp), [python3](./leetcode/127.word-ladder.py)| Other |\-|\-| - |
// A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers.
8
+
// Given a string s, return true if it is a palindrome, or false otherwise.
9
+
//
10
+
// Example 1:
11
+
//
12
+
// Input: s = "A man, a plan, a canal: Panama"
13
+
// Output: true
14
+
// Explanation: "amanaplanacanalpanama" is a palindrome.
15
+
//
16
+
// Example 2:
17
+
//
18
+
// Input: s = "race a car"
19
+
// Output: false
20
+
// Explanation: "raceacar" is not a palindrome.
21
+
//
22
+
// Example 3:
23
+
//
24
+
// Input: s = " "
25
+
// Output: true
26
+
// Explanation: s is an empty string "" after removing non-alphanumeric characters.
27
+
// Since an empty string reads the same forward and backward, it is a palindrome.
# A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers.
8
+
# Given a string s, return true if it is a palindrome, or false otherwise.
9
+
#
10
+
# Example 1:
11
+
#
12
+
# Input: s = "A man, a plan, a canal: Panama"
13
+
# Output: true
14
+
# Explanation: "amanaplanacanalpanama" is a palindrome.
15
+
#
16
+
# Example 2:
17
+
#
18
+
# Input: s = "race a car"
19
+
# Output: false
20
+
# Explanation: "raceacar" is not a palindrome.
21
+
#
22
+
# Example 3:
23
+
#
24
+
# Input: s = " "
25
+
# Output: true
26
+
# Explanation: s is an empty string "" after removing non-alphanumeric characters.
27
+
# Since an empty string reads the same forward and backward, it is a palindrome.
0 commit comments