-
Notifications
You must be signed in to change notification settings - Fork 1
/
data.sql
329 lines (321 loc) · 77.1 KB
/
data.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
--
-- Data for Name: Questions; Type: TABLE DATA; Schema: public; Owner: cs3219
--
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (1, 'Two Sum', 'https://leetcode.com/problems/two-sum', 'easy', 'Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. ', '{"Input: nums = [2,7,11,15], target = 9
Output: [0,1]
Explanation: Because nums[0] + nums[1] == 9, we return [0, 1].","Input: nums = [3,2,4], target = 6
Output: [1,2]","Input: nums = [3,3], target = 6
Output: [0,1]"}', '{"<code>2 <= nums.length <= 10<sup>4</sup></code>","<code>-10<sup>9</sup> <= nums[i] <= 10<sup>9</sup></code>","<code>-10<sup>9</sup> <= target <= 10<sup>9</sup></code>","Only one valid answer exists."}', '{Array,"Hash Table"}', '{"{\"title\": \"3Sum\", \"url\": \"https://leetcode.com/problems/3sum/\", \"difficulty\": \"medium\"}","{\"title\": \"4Sum\", \"url\": \"https://leetcode.com/problems/4sum/\", \"difficulty\": \"medium\"}","{\"title\": \"Two Sum II - Input Array Is Sorted\", \"url\": \"https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/\", \"difficulty\": \"medium\"}","{\"title\": \"Two Sum III - Data structure design\", \"url\": \"https://leetcode.com/problems/two-sum-iii-data-structure-design/\", \"difficulty\": \"easy\"}","{\"title\": \"Subarray Sum Equals K\", \"url\": \"https://leetcode.com/problems/subarray-sum-equals-k/\", \"difficulty\": \"medium\"}","{\"title\": \"Two Sum IV - Input is a BST\", \"url\": \"https://leetcode.com/problems/two-sum-iv-input-is-a-bst/\", \"difficulty\": \"easy\"}","{\"title\": \"Two Sum Less Than K\", \"url\": \"https://leetcode.com/problems/two-sum-less-than-k/\", \"difficulty\": \"easy\"}","{\"title\": \"Max Number of K-Sum Pairs\", \"url\": \"https://leetcode.com/problems/max-number-of-k-sum-pairs/\", \"difficulty\": \"medium\"}","{\"title\": \"Count Good Meals\", \"url\": \"https://leetcode.com/problems/count-good-meals/\", \"difficulty\": \"medium\"}","{\"title\": \"Count Number of Pairs With Absolute Difference K\", \"url\": \"https://leetcode.com/problems/count-number-of-pairs-with-absolute-difference-k/\", \"difficulty\": \"easy\"}","{\"title\": \"Number of Pairs of Strings With Concatenation Equal to Target\", \"url\": \"https://leetcode.com/problems/number-of-pairs-of-strings-with-concatenation-equal-to-target/\", \"difficulty\": \"medium\"}","{\"title\": \"Find All K-Distant Indices in an Array\", \"url\": \"https://leetcode.com/problems/find-all-k-distant-indices-in-an-array/\", \"difficulty\": \"easy\"}","{\"title\": \"First Letter to Appear Twice\", \"url\": \"https://leetcode.com/problems/first-letter-to-appear-twice/\", \"difficulty\": \"easy\"}","{\"title\": \"Number of Excellent Pairs\", \"url\": \"https://leetcode.com/problems/number-of-excellent-pairs/\", \"difficulty\": \"hard\"}","{\"title\": \"Number of Arithmetic Triplets\", \"url\": \"https://leetcode.com/problems/number-of-arithmetic-triplets/\", \"difficulty\": \"easy\"}","{\"title\": \"Node With Highest Edge Score\", \"url\": \"https://leetcode.com/problems/node-with-highest-edge-score/\", \"difficulty\": \"medium\"}","{\"title\": \"Check Distances Between Same Letters\", \"url\": \"https://leetcode.com/problems/check-distances-between-same-letters/\", \"difficulty\": \"easy\"}","{\"title\": \"Find Subarrays With Equal Sum\", \"url\": \"https://leetcode.com/problems/find-subarrays-with-equal-sum/\", \"difficulty\": \"easy\"}"}', '2022-09-09 16:01:35.467205+08', '2022-09-09 16:01:35.467205+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (2, 'Palindrome Number', 'https://leetcode.com/problems/palindrome-number', 'easy', 'Given an integer x, return true if x is palindrome integer. An integer is a palindrome when it reads the same backward as forward. For example, 121 is a palindrome while 123 is not.', '{"Input: x = 121
Output: true
Explanation: 121 reads as 121 from left to right and from right to left.","Input: x = -121
Output: false
Explanation: From left to right, it reads -121. From right to left, it becomes 121-. Therefore it is not a palindrome.","Input: x = 10
Output: false
Explanation: Reads 01 from right to left. Therefore it is not a palindrome."}', '{"<code>-2<sup>31</sup> <= x <= 2<sup>31</sup> - 1</code>"}', '{Math}', '{"{\"title\": \"Palindrome Linked List\", \"url\": \"https://leetcode.com/problems/palindrome-linked-list/\", \"difficulty\": \"easy\"}","{\"title\": \"Find Palindrome With Fixed Length\", \"url\": \"https://leetcode.com/problems/find-palindrome-with-fixed-length/\", \"difficulty\": \"medium\"}","{\"title\": \"Strictly Palindromic Number\", \"url\": \"https://leetcode.com/problems/strictly-palindromic-number/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.479265+08', '2022-09-09 16:01:35.479265+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (3, 'Longest Common Prefix', 'https://leetcode.com/problems/longest-common-prefix', 'easy', 'Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". ', '{"Input: strs = [\"flower\",\"flow\",\"flight\"]
Output: \"fl\"","Input: strs = [\"dog\",\"racecar\",\"car\"]
Output: \"\"
Explanation: There is no common prefix among the input strings."}', '{"<code>1 <= strs.length <= 200</code>","<code>0 <= strs[i].length <= 200</code>","<code>strs[i]</code> consists of only lowercase English letters."}', '{String}', '{}', '2022-09-09 16:01:35.479542+08', '2022-09-09 16:01:35.479542+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (4, 'Valid Parentheses', 'https://leetcode.com/problems/valid-parentheses', 'easy', 'Given a string s containing just the characters ''('', '')'', ''{'', ''}'', ''['' and '']'', determine if the input string is valid. An input string is valid if: (i) Open brackets must be closed by the same type of brackets. (ii) Open brackets must be closed in the correct order. (iii) Every close bracket has a corresponding open bracket of the same type. ', '{"Input: s = \"()\"
Output: true","Input: s = \"()[]{}\"
Output: true","Input: s = \"(]\"
Output: false"}', '{"<code>1 <= s.length <= 10<sup>4</sup></code>","<code>s</code> consists of parentheses only <code>''()[]{}''</code>."}', '{String,Stack}', '{"{\"title\": \"Generate Parentheses\", \"url\": \"https://leetcode.com/problems/generate-parentheses/\", \"difficulty\": \"medium\"}","{\"title\": \"Longest Valid Parentheses\", \"url\": \"https://leetcode.com/problems/longest-valid-parentheses/\", \"difficulty\": \"hard\"}","{\"title\": \"Remove Invalid Parentheses\", \"url\": \"https://leetcode.com/problems/remove-invalid-parentheses/\", \"difficulty\": \"hard\"}","{\"title\": \"Check If Word Is Valid After Substitutions\", \"url\": \"https://leetcode.com/problems/check-if-word-is-valid-after-substitutions/\", \"difficulty\": \"medium\"}","{\"title\": \"Check if a Parentheses String Can Be Valid\", \"url\": \"https://leetcode.com/problems/check-if-a-parentheses-string-can-be-valid/\", \"difficulty\": \"medium\"}","{\"title\": \"Move Pieces to Obtain a String\", \"url\": \"https://leetcode.com/problems/move-pieces-to-obtain-a-string/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.479795+08', '2022-09-09 16:01:35.479795+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (5, 'Merge Two Sorted Lists', 'https://leetcode.com/problems/merge-two-sorted-lists', 'easy', 'You are given the heads of two sorted linked lists list1 and list2. Merge the two lists in a one sorted list. The list should be made by splicing together the nodes of the first two lists. Return the head of the merged linked list. ', '{"Input: list1 = [1,2,4], list2 = [1,3,4]
Output: [1,1,2,3,4,4]","Input: list1 = [], list2 = []
Output: []","Input: list1 = [], list2 = [0]
Output: [0]"}', '{"The number of nodes in both lists is in the range <code>[0, 50]</code>.","<code>-100 <= Node.val <= 100</code>","Both <code>list1</code> and <code>list2</code> are sorted in non-decreasing order."}', '{"Linked List",Recursion}', '{"{\"title\": \"Merge k Sorted Lists\", \"url\": \"https://leetcode.com/problems/merge-k-sorted-lists/\", \"difficulty\": \"hard\"}","{\"title\": \"Merge Sorted Array\", \"url\": \"https://leetcode.com/problems/merge-sorted-array/\", \"difficulty\": \"easy\"}","{\"title\": \"Sort List\", \"url\": \"https://leetcode.com/problems/sort-list/\", \"difficulty\": \"medium\"}","{\"title\": \"Shortest Word Distance II\", \"url\": \"https://leetcode.com/problems/shortest-word-distance-ii/\", \"difficulty\": \"medium\"}","{\"title\": \"Add Two Polynomials Represented as Linked Lists\", \"url\": \"https://leetcode.com/problems/add-two-polynomials-represented-as-linked-lists/\", \"difficulty\": \"medium\"}","{\"title\": \"Longest Common Subsequence Between Sorted Arrays\", \"url\": \"https://leetcode.com/problems/longest-common-subsequence-between-sorted-arrays/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.480112+08', '2022-09-09 16:01:35.480112+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (6, 'Remove Duplicates from Sorted Array', 'https://leetcode.com/problems/remove-duplicates-from-sorted-array', 'easy', 'Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same. Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if there are k elements after removing the duplicates, then the first k elements of nums should hold the final result. It does not matter what you leave beyond the first k elements. Return k after placing the final result in the first k slots of nums. Do not allocate extra space for another array. You must do this by modifying the input array in-place with O(1) extra memory. ', '{"Input: nums = [1,1,2]
Output: 2, nums = [1,2,_]
Explanation: Your function should return k = 2, with the first two elements of nums being 1 and 2 respectively.
It does not matter what you leave beyond the returned k (hence they are underscores).","Input: nums = [0,0,1,1,1,2,2,3,3,4]
Output: 5, nums = [0,1,2,3,4,_,_,_,_,_]
Explanation: Your function should return k = 5, with the first five elements of nums being 0, 1, 2, 3, and 4 respectively.
It does not matter what you leave beyond the returned k (hence they are underscores)."}', '{"<code>1 <= nums.length <= 3 * 10<sup>4</sup></code>","<code>-100 <= nums[i] <= 100</code>","<code>nums</code> is sorted in non-decreasing order."}', '{Array,"Two Pointers"}', '{"{\"title\": \"Remove Element\", \"url\": \"https://leetcode.com/problems/remove-element/\", \"difficulty\": \"easy\"}","{\"title\": \"Remove Duplicates from Sorted Array II\", \"url\": \"https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.480362+08', '2022-09-09 16:01:35.480362+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (7, 'Remove Element', 'https://leetcode.com/problems/remove-element', 'easy', 'Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The relative order of the elements may be changed. Since it is impossible to change the length of the array in some languages, you must instead have the result be placed in the first part of the array nums. More formally, if there are k elements after removing the duplicates, then the first k elements of nums should hold the final result. It does not matter what you leave beyond the first k elements. Return k after placing the final result in the first k slots of nums. Do not allocate extra space for another array. You must do this by modifying the input array in-place with O(1) extra memory. ', '{"Input: nums = [3,2,2,3], val = 3
Output: 2, nums = [2,2,_,_]
Explanation: Your function should return k = 2, with the first two elements of nums being 2.
It does not matter what you leave beyond the returned k (hence they are underscores).","Input: nums = [0,1,2,2,3,0,4,2], val = 2
Output: 5, nums = [0,1,4,0,3,_,_,_]
Explanation: Your function should return k = 5, with the first five elements of nums containing 0, 0, 1, 3, and 4.
Note that the five elements can be returned in any order.
It does not matter what you leave beyond the returned k (hence they are underscores)."}', '{"<code>0 <= nums.length <= 100</code>","<code>0 <= nums[i] <= 50</code>","<code>0 <= val <= 100</code>"}', '{Array,"Two Pointers"}', '{"{\"title\": \"Remove Duplicates from Sorted Array\", \"url\": \"https://leetcode.com/problems/remove-duplicates-from-sorted-array/\", \"difficulty\": \"easy\"}","{\"title\": \"Remove Linked List Elements\", \"url\": \"https://leetcode.com/problems/remove-linked-list-elements/\", \"difficulty\": \"easy\"}","{\"title\": \"Move Zeroes\", \"url\": \"https://leetcode.com/problems/move-zeroes/\", \"difficulty\": \"easy\"}"}', '2022-09-09 16:01:35.481483+08', '2022-09-09 16:01:35.481483+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (8, 'Search Insert Position', 'https://leetcode.com/problems/search-insert-position', 'easy', 'Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You must write an algorithm with O(log n) runtime complexity. ', '{"Input: nums = [1,3,5,6], target = 5
Output: 2","Input: nums = [1,3,5,6], target = 2
Output: 1","Input: nums = [1,3,5,6], target = 7
Output: 4"}', '{"<code>1 <= nums.length <= 10<sup>4</sup></code>","<code>-10<sup>4</sup> <= nums[i] <= 10<sup>4</sup></code>","<code>nums</code> contains distinct values sorted in ascending order.","<code>-10<sup>4</sup> <= target <= 10<sup>4</sup></code>"}', '{Array,"Binary Search"}', '{"{\"title\": \"First Bad Version\", \"url\": \"https://leetcode.com/problems/first-bad-version/\", \"difficulty\": \"easy\"}"}', '2022-09-09 16:01:35.481754+08', '2022-09-09 16:01:35.481754+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (9, 'Length of Last Word', 'https://leetcode.com/problems/length-of-last-word', 'easy', 'Given a string s consisting of words and spaces, return the length of the last word in the string. A word is a maximal substring consisting of non-space characters only. ', '{"Input: s = \"Hello World\"
Output: 5
Explanation: The last word is \"World\" with length 5.","Input: s = \" fly me to the moon \"
Output: 4
Explanation: The last word is \"moon\" with length 4.","Input: s = \"luffy is still joyboy\"
Output: 6
Explanation: The last word is \"joyboy\" with length 6."}', '{"<code>1 <= s.length <= 10<sup>4</sup></code>","<code>s</code> consists of only English letters and spaces <code>'' ''</code>.","There will be at least one word in <code>s</code>."}', '{String}', '{}', '2022-09-09 16:01:35.481933+08', '2022-09-09 16:01:35.481933+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (10, 'Plus One', 'https://leetcode.com/problems/plus-one', 'easy', 'You are given a large integer represented as an integer array digits, where each digits[i] is the i<sup>th</sup> digit of the integer. The digits are ordered from most significant to least significant in left-to-right order. The large integer does not contain any leading 0''s. Increment the large integer by one and return the resulting array of digits. ', '{"Input: digits = [1,2,3]
Output: [1,2,4]
Explanation: The array represents the integer 123.
Incrementing by one gives 123 + 1 = 124.
Thus, the result should be [1,2,4].","Input: digits = [4,3,2,1]
Output: [4,3,2,2]
Explanation: The array represents the integer 4321.
Incrementing by one gives 4321 + 1 = 4322.
Thus, the result should be [4,3,2,2].","Input: digits = [9]
Output: [1,0]
Explanation: The array represents the integer 9.
Incrementing by one gives 9 + 1 = 10.
Thus, the result should be [1,0]."}', '{"<code>1 <= digits.length <= 100</code>","<code>0 <= digits[i] <= 9</code>","<code>digits</code> does not contain any leading <code>0</code>''s."}', '{Array,Math}', '{"{\"title\": \"Multiply Strings\", \"url\": \"https://leetcode.com/problems/multiply-strings/\", \"difficulty\": \"medium\"}","{\"title\": \"Add Binary\", \"url\": \"https://leetcode.com/problems/add-binary/\", \"difficulty\": \"easy\"}","{\"title\": \"Plus One Linked List\", \"url\": \"https://leetcode.com/problems/plus-one-linked-list/\", \"difficulty\": \"medium\"}","{\"title\": \"Add to Array-Form of Integer\", \"url\": \"https://leetcode.com/problems/add-to-array-form-of-integer/\", \"difficulty\": \"easy\"}"}', '2022-09-09 16:01:35.482139+08', '2022-09-09 16:01:35.482139+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (11, 'Add Binary', 'https://leetcode.com/problems/add-binary', 'easy', 'Given two binary strings a and b, return their sum as a binary string. ', '{"Input: a = \"11\", b = \"1\"
Output: \"100\"","Input: a = \"1010\", b = \"1011\"
Output: \"10101\""}', '{"<code>1 <= a.length, b.length <= 10<sup>4</sup></code>","<code>a</code> and <code>b</code> consist only of <code>''0''</code> or <code>''1''</code> characters.","Each string does not contain leading zeros except for the zero itself."}', '{Math,String,"Bit Manipulation",Simulation}', '{"{\"title\": \"Add Two Numbers\", \"url\": \"https://leetcode.com/problems/add-two-numbers/\", \"difficulty\": \"medium\"}","{\"title\": \"Multiply Strings\", \"url\": \"https://leetcode.com/problems/multiply-strings/\", \"difficulty\": \"medium\"}","{\"title\": \"Plus One\", \"url\": \"https://leetcode.com/problems/plus-one/\", \"difficulty\": \"easy\"}","{\"title\": \"Add to Array-Form of Integer\", \"url\": \"https://leetcode.com/problems/add-to-array-form-of-integer/\", \"difficulty\": \"easy\"}"}', '2022-09-09 16:01:35.482331+08', '2022-09-09 16:01:35.482331+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (12, 'Sqrt(x)', 'https://leetcode.com/problems/sqrtx', 'easy', 'Given a non-negative integer x, compute and return the square root of x. Since the return type is an integer, the decimal digits are truncated, and only the integer part of the result is returned. Note: You are not allowed to use any built-in exponent function or operator, such as pow(x, 0.5) or x ** 0.5. ', '{"Input: x = 4
Output: 2","Input: x = 8
Output: 2
Explanation: The square root of 8 is 2.82842..., and since the decimal part is truncated, 2 is returned."}', '{"<code>0 <= x <= 2<sup>31</sup> - 1</code>"}', '{Math,"Binary Search"}', '{"{\"title\": \"Pow(x, n)\", \"url\": \"https://leetcode.com/problems/powx-n/\", \"difficulty\": \"medium\"}","{\"title\": \"Valid Perfect Square\", \"url\": \"https://leetcode.com/problems/valid-perfect-square/\", \"difficulty\": \"easy\"}"}', '2022-09-09 16:01:35.482556+08', '2022-09-09 16:01:35.482556+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (13, 'Climbing Stairs', 'https://leetcode.com/problems/climbing-stairs', 'easy', 'You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? ', '{"Input: n = 2
Output: 2
Explanation: There are two ways to climb to the top.
1. 1 step + 1 step
2. 2 steps","Input: n = 3
Output: 3
Explanation: There are three ways to climb to the top.
1. 1 step + 1 step + 1 step
2. 1 step + 2 steps
3. 2 steps + 1 step"}', '{"<code>1 <= n <= 45</code>"}', '{Math,"Dynamic Programming",Memoization}', '{"{\"title\": \"Min Cost Climbing Stairs\", \"url\": \"https://leetcode.com/problems/min-cost-climbing-stairs/\", \"difficulty\": \"easy\"}","{\"title\": \"Fibonacci Number\", \"url\": \"https://leetcode.com/problems/fibonacci-number/\", \"difficulty\": \"easy\"}","{\"title\": \"N-th Tribonacci Number\", \"url\": \"https://leetcode.com/problems/n-th-tribonacci-number/\", \"difficulty\": \"easy\"}","{\"title\": \"Minimum Rounds to Complete All Tasks\", \"url\": \"https://leetcode.com/problems/minimum-rounds-to-complete-all-tasks/\", \"difficulty\": \"medium\"}","{\"title\": \"Count Number of Ways to Place Houses\", \"url\": \"https://leetcode.com/problems/count-number-of-ways-to-place-houses/\", \"difficulty\": \"medium\"}","{\"title\": \"Number of Ways to Reach a Position After Exactly k Steps\", \"url\": \"https://leetcode.com/problems/number-of-ways-to-reach-a-position-after-exactly-k-steps/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.48274+08', '2022-09-09 16:01:35.48274+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (14, 'Remove Duplicates from Sorted List', 'https://leetcode.com/problems/remove-duplicates-from-sorted-list', 'easy', 'Given the head of a sorted linked list, delete all duplicates such that each element appears only once. Return the linked list sorted as well. ', '{"Input: head = [1,1,2]
Output: [1,2]","Input: head = [1,1,2,3,3]
Output: [1,2,3]"}', '{"The number of nodes in the list is in the range <code>[0, 300]</code>.","<code>-100 <= Node.val <= 100</code>","The list is guaranteed to be sorted in ascending order."}', '{"Linked List"}', '{"{\"title\": \"Remove Duplicates from Sorted List II\", \"url\": \"https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/\", \"difficulty\": \"medium\"}","{\"title\": \"Remove Duplicates From an Unsorted Linked List\", \"url\": \"https://leetcode.com/problems/remove-duplicates-from-an-unsorted-linked-list/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.482954+08', '2022-09-09 16:01:35.482954+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (15, 'Merge Sorted Array', 'https://leetcode.com/problems/merge-sorted-array', 'easy', 'You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively. Merge nums1 and nums2 into a single array sorted in non-decreasing order. The final sorted array should not be returned by the function, but instead be stored inside the array nums1. To accommodate this, nums1 has a length of m + n, where the first m elements denote the elements that should be merged, and the last n elements are set to 0 and should be ignored. nums2 has a length of n. ', '{"Input: nums1 = [1,2,3,0,0,0], m = 3, nums2 = [2,5,6], n = 3
Output: [1,2,2,3,5,6]
Explanation: The arrays we are merging are [1,2,3] and [2,5,6].
The result of the merge is [<u>1</u>,<u>2</u>,2,<u>3</u>,5,6] with the underlined elements coming from nums1.","Input: nums1 = [1], m = 1, nums2 = [], n = 0
Output: [1]
Explanation: The arrays we are merging are [1] and [].
The result of the merge is [1].","Input: nums1 = [0], m = 0, nums2 = [1], n = 1
Output: [1]
Explanation: The arrays we are merging are [] and [1].
The result of the merge is [1].
Note that because m = 0, there are no elements in nums1. The 0 is only there to ensure the merge result can fit in nums1."}', '{"<code>nums1.length == m + n</code>","<code>nums2.length == n</code>","<code>0 <= m, n <= 200</code>","<code>1 <= m + n <= 200</code>","<code>-10<sup>9</sup> <= nums1[i], nums2[j] <= 10<sup>9</sup></code>"}', '{Array,"Two Pointers",Sorting}', '{"{\"title\": \"Merge Two Sorted Lists\", \"url\": \"https://leetcode.com/problems/merge-two-sorted-lists/\", \"difficulty\": \"easy\"}","{\"title\": \"Squares of a Sorted Array\", \"url\": \"https://leetcode.com/problems/squares-of-a-sorted-array/\", \"difficulty\": \"easy\"}","{\"title\": \"Interval List Intersections\", \"url\": \"https://leetcode.com/problems/interval-list-intersections/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.483169+08', '2022-09-09 16:01:35.483169+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (27, '4Sum', 'https://leetcode.com/problems/4sum', 'medium', 'Given an array nums of n integers, return an array of all the unique quadruplets [nums[a], nums[b], nums[c], nums[d]] such that: (i) 0 <= a, b, c, d < n (ii) a, b, c, and d are distinct. (iii) nums[a] + nums[b] + nums[c] + nums[d] == target. You may return the answer in any order. ', '{"Input: nums = [1,0,-1,0,-2,2], target = 0
Output: [[-2,-1,1,2],[-2,0,0,2],[-1,0,0,1]]","Input: nums = [2,2,2,2,2], target = 8
Output: [[2,2,2,2]]"}', '{"<code>1 <= nums.length <= 200</code>","<code>-10<sup>9</sup> <= nums[i] <= 10<sup>9</sup></code>","<code>-10<sup>9</sup> <= target <= 10<sup>9</sup></code>"}', '{Array,"Two Pointers",Sorting}', '{"{\"title\": \"Two Sum\", \"url\": \"https://leetcode.com/problems/two-sum/\", \"difficulty\": \"easy\"}","{\"title\": \"3Sum\", \"url\": \"https://leetcode.com/problems/3sum/\", \"difficulty\": \"medium\"}","{\"title\": \"4Sum II\", \"url\": \"https://leetcode.com/problems/4sum-ii/\", \"difficulty\": \"medium\"}","{\"title\": \"Count Special Quadruplets\", \"url\": \"https://leetcode.com/problems/count-special-quadruplets/\", \"difficulty\": \"easy\"}"}', '2022-09-09 16:01:35.485519+08', '2022-09-09 16:01:35.485519+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (16, 'Binary Tree Inorder Traversal', 'https://leetcode.com/problems/binary-tree-inorder-traversal', 'easy', 'Given the root of a binary tree, return the inorder traversal of its nodes'' values. ', '{"Input: root = [1,null,2,3]
Output: [1,3,2]","Input: root = []
Output: []","Input: root = [1]
Output: [1]"}', '{"The number of nodes in the tree is in the range <code>[0, 100]</code>.","<code>-100 <= Node.val <= 100</code>"}', '{Stack,Tree,"Depth-First Search","Binary Tree"}', '{"{\"title\": \"Validate Binary Search Tree\", \"url\": \"https://leetcode.com/problems/validate-binary-search-tree/\", \"difficulty\": \"medium\"}","{\"title\": \"Binary Tree Preorder Traversal\", \"url\": \"https://leetcode.com/problems/binary-tree-preorder-traversal/\", \"difficulty\": \"easy\"}","{\"title\": \"Binary Tree Postorder Traversal\", \"url\": \"https://leetcode.com/problems/binary-tree-postorder-traversal/\", \"difficulty\": \"easy\"}","{\"title\": \"Binary Search Tree Iterator\", \"url\": \"https://leetcode.com/problems/binary-search-tree-iterator/\", \"difficulty\": \"medium\"}","{\"title\": \"Kth Smallest Element in a BST\", \"url\": \"https://leetcode.com/problems/kth-smallest-element-in-a-bst/\", \"difficulty\": \"medium\"}","{\"title\": \"Closest Binary Search Tree Value II\", \"url\": \"https://leetcode.com/problems/closest-binary-search-tree-value-ii/\", \"difficulty\": \"hard\"}","{\"title\": \"Inorder Successor in BST\", \"url\": \"https://leetcode.com/problems/inorder-successor-in-bst/\", \"difficulty\": \"medium\"}","{\"title\": \"Convert Binary Search Tree to Sorted Doubly Linked List\", \"url\": \"https://leetcode.com/problems/convert-binary-search-tree-to-sorted-doubly-linked-list/\", \"difficulty\": \"medium\"}","{\"title\": \"Minimum Distance Between BST Nodes\", \"url\": \"https://leetcode.com/problems/minimum-distance-between-bst-nodes/\", \"difficulty\": \"easy\"}"}', '2022-09-09 16:01:35.483453+08', '2022-09-09 16:01:35.483453+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (17, 'Same Tree', 'https://leetcode.com/problems/same-tree', 'easy', 'Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical, and the nodes have the same value. ', '{"Input: p = [1,2,3], q = [1,2,3]
Output: true","Input: p = [1,2], q = [1,null,2]
Output: false","Input: p = [1,2,1], q = [1,1,2]
Output: false"}', '{"The number of nodes in both trees is in the range <code>[0, 100]</code>.","<code>-10<sup>4</sup> <= Node.val <= 10<sup>4</sup></code>"}', '{Tree,"Depth-First Search","Breadth-First Search","Binary Tree"}', '{}', '2022-09-09 16:01:35.483681+08', '2022-09-09 16:01:35.483681+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (18, 'Symmetric Tree', 'https://leetcode.com/problems/symmetric-tree', 'easy', 'Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center). ', '{"Input: root = [1,2,2,3,4,4,3]
Output: true","Input: root = [1,2,2,null,3,null,3]
Output: false"}', '{"The number of nodes in the tree is in the range <code>[1, 1000]</code>.","<code>-100 <= Node.val <= 100</code>"}', '{Tree,"Depth-First Search","Breadth-First Search","Binary Tree"}', '{}', '2022-09-09 16:01:35.483879+08', '2022-09-09 16:01:35.483879+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (19, 'Maximum Depth of Binary Tree', 'https://leetcode.com/problems/maximum-depth-of-binary-tree', 'easy', 'Given the root of a binary tree, return its maximum depth. A binary tree''s maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node. ', '{"Input: root = [3,9,20,null,null,15,7]
Output: 3","Input: root = [1,null,2]
Output: 2"}', '{"The number of nodes in the tree is in the range <code>[0, 10<sup>4</sup>]</code>.","<code>-100 <= Node.val <= 100</code>"}', '{Tree,"Depth-First Search","Breadth-First Search","Binary Tree"}', '{"{\"title\": \"Balanced Binary Tree\", \"url\": \"https://leetcode.com/problems/balanced-binary-tree/\", \"difficulty\": \"easy\"}","{\"title\": \"Minimum Depth of Binary Tree\", \"url\": \"https://leetcode.com/problems/minimum-depth-of-binary-tree/\", \"difficulty\": \"easy\"}","{\"title\": \"Maximum Depth of N-ary Tree\", \"url\": \"https://leetcode.com/problems/maximum-depth-of-n-ary-tree/\", \"difficulty\": \"easy\"}","{\"title\": \"Time Needed to Inform All Employees\", \"url\": \"https://leetcode.com/problems/time-needed-to-inform-all-employees/\", \"difficulty\": \"medium\"}","{\"title\": \"Amount of Time for Binary Tree to Be Infected\", \"url\": \"https://leetcode.com/problems/amount-of-time-for-binary-tree-to-be-infected/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.484058+08', '2022-09-09 16:01:35.484058+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (20, 'Add Two Numbers', 'https://leetcode.com/problems/add-two-numbers', 'medium', 'You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself. ', '{"Input: l1 = [2,4,3], l2 = [5,6,4]
Output: [7,0,8]
Explanation: 342 + 465 = 807.","Input: l1 = [0], l2 = [0]
Output: [0]","Input: l1 = [9,9,9,9,9,9,9], l2 = [9,9,9,9]
Output: [8,9,9,9,0,0,0,1]"}', '{"The number of nodes in each linked list is in the range <code>[1, 100]</code>.","<code>0 <= Node.val <= 9</code>","It is guaranteed that the list represents a number that does not have leading zeros."}', '{"Linked List",Math,Recursion}', '{"{\"title\": \"Multiply Strings\", \"url\": \"https://leetcode.com/problems/multiply-strings/\", \"difficulty\": \"medium\"}","{\"title\": \"Add Binary\", \"url\": \"https://leetcode.com/problems/add-binary/\", \"difficulty\": \"easy\"}","{\"title\": \"Sum of Two Integers\", \"url\": \"https://leetcode.com/problems/sum-of-two-integers/\", \"difficulty\": \"medium\"}","{\"title\": \"Add Strings\", \"url\": \"https://leetcode.com/problems/add-strings/\", \"difficulty\": \"easy\"}","{\"title\": \"Add Two Numbers II\", \"url\": \"https://leetcode.com/problems/add-two-numbers-ii/\", \"difficulty\": \"medium\"}","{\"title\": \"Add to Array-Form of Integer\", \"url\": \"https://leetcode.com/problems/add-to-array-form-of-integer/\", \"difficulty\": \"easy\"}","{\"title\": \"Add Two Polynomials Represented as Linked Lists\", \"url\": \"https://leetcode.com/problems/add-two-polynomials-represented-as-linked-lists/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.484223+08', '2022-09-09 16:01:35.484223+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (28, 'Remove Nth Node From End of List', 'https://leetcode.com/problems/remove-nth-node-from-end-of-list', 'medium', 'Given the head of a linked list, remove the n<sup>th</sup> node from the end of the list and return its head. ', '{"Input: head = [1,2,3,4,5], n = 2
Output: [1,2,3,5]","Input: head = [1], n = 1
Output: []","Input: head = [1,2], n = 1
Output: [1]"}', '{"The number of nodes in the list is <code>sz</code>.","<code>1 <= sz <= 30</code>","<code>0 <= Node.val <= 100</code>","<code>1 <= n <= sz</code>"}', '{"Linked List","Two Pointers"}', '{"{\"title\": \"Swapping Nodes in a Linked List\", \"url\": \"https://leetcode.com/problems/swapping-nodes-in-a-linked-list/\", \"difficulty\": \"medium\"}","{\"title\": \"Delete N Nodes After M Nodes of a Linked List\", \"url\": \"https://leetcode.com/problems/delete-n-nodes-after-m-nodes-of-a-linked-list/\", \"difficulty\": \"easy\"}","{\"title\": \"Delete the Middle Node of a Linked List\", \"url\": \"https://leetcode.com/problems/delete-the-middle-node-of-a-linked-list/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.485723+08', '2022-09-09 16:01:35.485723+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (21, 'Longest Substring Without Repeating Characters', 'https://leetcode.com/problems/longest-substring-without-repeating-characters', 'medium', 'Given a string s, find the length of the longest substring without repeating characters. ', '{"Input: s = \"abcabcbb\"
Output: 3
Explanation: The answer is \"abc\", with the length of 3.","Input: s = \"bbbbb\"
Output: 1
Explanation: The answer is \"b\", with the length of 1.","Input: s = \"pwwkew\"
Output: 3
Explanation: The answer is \"wke\", with the length of 3.
Notice that the answer must be a substring, \"pwke\" is a subsequence and not a substring."}', '{"<code>0 <= s.length <= 5 * 10<sup>4</sup></code>","<code>s</code> consists of English letters, digits, symbols and spaces."}', '{"Hash Table",String,"Sliding Window"}', '{"{\"title\": \"Longest Substring with At Most Two Distinct Characters\", \"url\": \"https://leetcode.com/problems/longest-substring-with-at-most-two-distinct-characters/\", \"difficulty\": \"medium\"}","{\"title\": \"Longest Substring with At Most K Distinct Characters\", \"url\": \"https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters/\", \"difficulty\": \"medium\"}","{\"title\": \"Subarrays with K Different Integers\", \"url\": \"https://leetcode.com/problems/subarrays-with-k-different-integers/\", \"difficulty\": \"hard\"}","{\"title\": \"Maximum Erasure Value\", \"url\": \"https://leetcode.com/problems/maximum-erasure-value/\", \"difficulty\": \"medium\"}","{\"title\": \"Number of Equal Count Substrings\", \"url\": \"https://leetcode.com/problems/number-of-equal-count-substrings/\", \"difficulty\": \"medium\"}","{\"title\": \"Minimum Consecutive Cards to Pick Up\", \"url\": \"https://leetcode.com/problems/minimum-consecutive-cards-to-pick-up/\", \"difficulty\": \"medium\"}","{\"title\": \"Longest Nice Subarray\", \"url\": \"https://leetcode.com/problems/longest-nice-subarray/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.484417+08', '2022-09-09 16:01:35.484417+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (22, 'Longest Palindromic Substring', 'https://leetcode.com/problems/longest-palindromic-substring', 'medium', 'Given a string s, return the longest palindromic substring in s. ', '{"Input: s = \"babad\"
Output: \"bab\"
Explanation: \"aba\" is also a valid answer.","Input: s = \"cbbd\"
Output: \"bb\""}', '{"<code>1 <= s.length <= 1000</code>","<code>s</code> consist of only digits and English letters."}', '{String,"Dynamic Programming"}', '{"{\"title\": \"Shortest Palindrome\", \"url\": \"https://leetcode.com/problems/shortest-palindrome/\", \"difficulty\": \"hard\"}","{\"title\": \"Palindrome Permutation\", \"url\": \"https://leetcode.com/problems/palindrome-permutation/\", \"difficulty\": \"easy\"}","{\"title\": \"Palindrome Pairs\", \"url\": \"https://leetcode.com/problems/palindrome-pairs/\", \"difficulty\": \"hard\"}","{\"title\": \"Longest Palindromic Subsequence\", \"url\": \"https://leetcode.com/problems/longest-palindromic-subsequence/\", \"difficulty\": \"medium\"}","{\"title\": \"Palindromic Substrings\", \"url\": \"https://leetcode.com/problems/palindromic-substrings/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.484648+08', '2022-09-09 16:01:35.484648+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (23, 'Reverse Integer', 'https://leetcode.com/problems/reverse-integer', 'medium', 'Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-2<sup>31</sup>, 2<sup>31</sup> - 1], then return 0. Assume the environment does not allow you to store 64-bit integers (signed or unsigned). ', '{"Input: x = 123
Output: 321","Input: x = -123
Output: -321","Input: x = 120
Output: 21"}', '{"<code>-2<sup>31</sup> <= x <= 2<sup>31</sup> - 1</code>"}', '{Math}', '{"{\"title\": \"String to Integer (atoi)\", \"url\": \"https://leetcode.com/problems/string-to-integer-atoi/\", \"difficulty\": \"medium\"}","{\"title\": \"Reverse Bits\", \"url\": \"https://leetcode.com/problems/reverse-bits/\", \"difficulty\": \"easy\"}","{\"title\": \"A Number After a Double Reversal\", \"url\": \"https://leetcode.com/problems/a-number-after-a-double-reversal/\", \"difficulty\": \"easy\"}"}', '2022-09-09 16:01:35.484811+08', '2022-09-09 16:01:35.484811+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (24, 'Container With Most Water', 'https://leetcode.com/problems/container-with-most-water', 'medium', 'You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the i<sup>th</sup> line are (i, 0) and (i, height[i]). Find two lines that together with the x-axis form a container, such that the container contains the most water. Return the maximum amount of water a container can store. Notice that you may not slant the container. ', '{"Input: height = [1,8,6,2,5,4,8,3,7]
Output: 49
Explanation: The above vertical lines are represented by array [1,8,6,2,5,4,8,3,7]. In this case, the max area of water (blue section) the container can contain is 49.","Input: height = [1,1]
Output: 1"}', '{"<code>n == height.length</code>","<code>2 <= n <= 10<sup>5</sup></code>","<code>0 <= height[i] <= 10<sup>4</sup></code>"}', '{Array,"Two Pointers",Greedy}', '{"{\"title\": \"Trapping Rain Water\", \"url\": \"https://leetcode.com/problems/trapping-rain-water/\", \"difficulty\": \"hard\"}"}', '2022-09-09 16:01:35.485001+08', '2022-09-09 16:01:35.485001+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (25, '3Sum', 'https://leetcode.com/problems/3sum', 'medium', 'Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0. Notice that the solution set must not contain duplicate triplets. ', '{"Input: nums = [-1,0,1,2,-1,-4]
Output: [[-1,-1,2],[-1,0,1]]
Explanation:
nums[0] + nums[1] + nums[2] = (-1) + 0 + 1 = 0.
nums[1] + nums[2] + nums[4] = 0 + 1 + (-1) = 0.
nums[0] + nums[3] + nums[4] = (-1) + 2 + (-1) = 0.
The distinct triplets are [-1,0,1] and [-1,-1,2].
Notice that the order of the output and the order of the triplets does not matter.","Input: nums = [0,1,1]
Output: []
Explanation: The only possible triplet does not sum up to 0.","Input: nums = [0,0,0]
Output: [[0,0,0]]
Explanation: The only possible triplet sums up to 0."}', '{"<code>3 <= nums.length <= 3000</code>","<code>-10<sup>5</sup> <= nums[i] <= 10<sup>5</sup></code>"}', '{Array,"Two Pointers",Sorting}', '{"{\"title\": \"Two Sum\", \"url\": \"https://leetcode.com/problems/two-sum/\", \"difficulty\": \"easy\"}","{\"title\": \"3Sum Closest\", \"url\": \"https://leetcode.com/problems/3sum-closest/\", \"difficulty\": \"medium\"}","{\"title\": \"4Sum\", \"url\": \"https://leetcode.com/problems/4sum/\", \"difficulty\": \"medium\"}","{\"title\": \"3Sum Smaller\", \"url\": \"https://leetcode.com/problems/3sum-smaller/\", \"difficulty\": \"medium\"}","{\"title\": \"Number of Arithmetic Triplets\", \"url\": \"https://leetcode.com/problems/number-of-arithmetic-triplets/\", \"difficulty\": \"easy\"}"}', '2022-09-09 16:01:35.485177+08', '2022-09-09 16:01:35.485177+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (26, '3Sum Closest', 'https://leetcode.com/problems/3sum-closest', 'medium', 'Given an integer array nums of length n and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each input would have exactly one solution. ', '{"Input: nums = [-1,2,1,-4], target = 1
Output: 2
Explanation: The sum that is closest to the target is 2. (-1 + 2 + 1 = 2).","Input: nums = [0,0,0], target = 1
Output: 0"}', '{"<code>3 <= nums.length <= 1000</code>","<code>-1000 <= nums[i] <= 1000</code>","<code>-10<sup>4</sup> <= target <= 10<sup>4</sup></code>"}', '{Array,"Two Pointers",Sorting}', '{"{\"title\": \"3Sum\", \"url\": \"https://leetcode.com/problems/3sum/\", \"difficulty\": \"medium\"}","{\"title\": \"3Sum Smaller\", \"url\": \"https://leetcode.com/problems/3sum-smaller/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.485369+08', '2022-09-09 16:01:35.485369+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (29, 'Generate Parentheses', 'https://leetcode.com/problems/generate-parentheses', 'medium', 'Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. ', '{"Input: n = 3
Output: [\"((()))\",\"(()())\",\"(())()\",\"()(())\",\"()()()\"]","Input: n = 1
Output: [\"()\"]"}', '{"<code>1 <= n <= 8</code>"}', '{String,"Dynamic Programming",Backtracking}', '{"{\"title\": \"Letter Combinations of a Phone Number\", \"url\": \"https://leetcode.com/problems/letter-combinations-of-a-phone-number/\", \"difficulty\": \"medium\"}","{\"title\": \"Valid Parentheses\", \"url\": \"https://leetcode.com/problems/valid-parentheses/\", \"difficulty\": \"easy\"}","{\"title\": \"Check if a Parentheses String Can Be Valid\", \"url\": \"https://leetcode.com/problems/check-if-a-parentheses-string-can-be-valid/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.485875+08', '2022-09-09 16:01:35.485875+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (30, 'Swap Nodes in Pairs', 'https://leetcode.com/problems/swap-nodes-in-pairs', 'medium', 'Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list''s nodes (i.e., only nodes themselves may be changed.) ', '{"Input: head = [1,2,3,4]
Output: [2,1,4,3]","Input: head = []
Output: []","Input: head = [1]
Output: [1]"}', '{"The number of nodes in the list is in the range <code>[0, 100]</code>.","<code>0 <= Node.val <= 100</code>"}', '{"Linked List",Recursion}', '{"{\"title\": \"Reverse Nodes in k-Group\", \"url\": \"https://leetcode.com/problems/reverse-nodes-in-k-group/\", \"difficulty\": \"hard\"}","{\"title\": \"Swapping Nodes in a Linked List\", \"url\": \"https://leetcode.com/problems/swapping-nodes-in-a-linked-list/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.486102+08', '2022-09-09 16:01:35.486102+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (31, 'Find the Index of the First Occurrence in a String', 'https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string', 'medium', 'Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. ', '{"Input: haystack = \"sadbutsad\", needle = \"sad\"
Output: 0
Explanation: \"sad\" occurs at index 0 and 6.
The first occurrence is at index 0, so we return 0.","Input: haystack = \"leetcode\", needle = \"leeto\"
Output: -1
Explanation: \"leeto\" did not occur in \"leetcode\", so we return -1."}', '{"<code>1 <= haystack.length, needle.length <= 10<sup>4</sup></code>","<code>haystack</code> and <code>needle</code> consist of only lowercase English characters."}', '{"Two Pointers",String,"String Matching"}', '{"{\"title\": \"Shortest Palindrome\", \"url\": \"https://leetcode.com/problems/shortest-palindrome/\", \"difficulty\": \"hard\"}","{\"title\": \"Repeated Substring Pattern\", \"url\": \"https://leetcode.com/problems/repeated-substring-pattern/\", \"difficulty\": \"easy\"}"}', '2022-09-09 16:01:35.486267+08', '2022-09-09 16:01:35.486267+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (32, 'Divide Two Integers', 'https://leetcode.com/problems/divide-two-integers', 'medium', 'Given two integers dividend and divisor, divide two integers without using multiplication, division, and mod operator. The integer division should truncate toward zero, which means losing its fractional part. For example, 8.345 would be truncated to 8, and -2.7335 would be truncated to -2. Return the quotient after dividing dividend by divisor. Note: Assume we are dealing with an environment that could only store integers within the 32-bit signed integer range: [−2<sup>31</sup>, 2<sup>31</sup> − 1]. For this problem, if the quotient is strictly greater than 2<sup>31</sup> - 1, then return 2<sup>31</sup> - 1, and if the quotient is strictly less than -2<sup>31</sup>, then return -2<sup>31</sup>. ', '{"Input: dividend = 10, divisor = 3
Output: 3
Explanation: 10/3 = 3.33333.. which is truncated to 3.","Input: dividend = 7, divisor = -3
Output: -2
Explanation: 7/-3 = -2.33333.. which is truncated to -2."}', '{"<code>-2<sup>31</sup> <= dividend, divisor <= 2<sup>31</sup> - 1</code>","<code>divisor != 0</code>"}', '{Math,"Bit Manipulation"}', '{}', '2022-09-09 16:01:35.486414+08', '2022-09-09 16:01:35.486414+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (33, 'Search in Rotated Sorted Array', 'https://leetcode.com/problems/search-in-rotated-sorted-array', 'medium', 'There is an integer array nums sorted in ascending order (with distinct values). Prior to being passed to your function, nums is possibly rotated at an unknown pivot index k (1 <= k < nums.length) such that the resulting array is [nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]] (0-indexed). For example, [0,1,2,4,5,6,7] might be rotated at pivot index 3 and become [4,5,6,7,0,1,2]. Given the array nums after the possible rotation and an integer target, return the index of target if it is in nums, or -1 if it is not in nums. You must write an algorithm with O(log n) runtime complexity. ', '{"Input: nums = [4,5,6,7,0,1,2], target = 0
Output: 4","Input: nums = [4,5,6,7,0,1,2], target = 3
Output: -1","Input: nums = [1], target = 0
Output: -1"}', '{"<code>1 <= nums.length <= 5000</code>","<code>-10<sup>4</sup> <= nums[i] <= 10<sup>4</sup></code>","All values of <code>nums</code> are unique.","<code>nums</code> is an ascending array that is possibly rotated.","<code>-10<sup>4</sup> <= target <= 10<sup>4</sup></code>"}', '{Array,"Binary Search"}', '{"{\"title\": \"Search in Rotated Sorted Array II\", \"url\": \"https://leetcode.com/problems/search-in-rotated-sorted-array-ii/\", \"difficulty\": \"medium\"}","{\"title\": \"Find Minimum in Rotated Sorted Array\", \"url\": \"https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/\", \"difficulty\": \"medium\"}","{\"title\": \"Pour Water Between Buckets to Make Water Levels Equal\", \"url\": \"https://leetcode.com/problems/pour-water-between-buckets-to-make-water-levels-equal/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.486584+08', '2022-09-09 16:01:35.486584+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (34, 'Find First and Last Position of Element in Sorted Array', 'https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array', 'medium', 'Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found in the array, return [-1, -1]. You must write an algorithm with O(log n) runtime complexity. ', '{"Input: nums = [5,7,7,8,8,10], target = 8
Output: [3,4]","Input: nums = [5,7,7,8,8,10], target = 6
Output: [-1,-1]","Input: nums = [], target = 0
Output: [-1,-1]"}', '{"<code>0 <= nums.length <= 10<sup>5</sup></code>","<code>-10<sup>9</sup> <= nums[i] <= 10<sup>9</sup></code>","<code>nums</code> is a non-decreasing array.","<code>-10<sup>9</sup> <= target <= 10<sup>9</sup></code>"}', '{Array,"Binary Search"}', '{"{\"title\": \"First Bad Version\", \"url\": \"https://leetcode.com/problems/first-bad-version/\", \"difficulty\": \"easy\"}","{\"title\": \"Plates Between Candles\", \"url\": \"https://leetcode.com/problems/plates-between-candles/\", \"difficulty\": \"medium\"}","{\"title\": \"Find Target Indices After Sorting Array\", \"url\": \"https://leetcode.com/problems/find-target-indices-after-sorting-array/\", \"difficulty\": \"easy\"}"}', '2022-09-09 16:01:35.486747+08', '2022-09-09 16:01:35.486747+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (35, 'Median of Two Sorted Arrays', 'https://leetcode.com/problems/median-of-two-sorted-arrays', 'hard', 'Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). ', '{"Input: nums1 = [1,3], nums2 = [2]
Output: 2.00000
Explanation: merged array = [1,2,3] and median is 2.","Input: nums1 = [1,2], nums2 = [3,4]
Output: 2.50000
Explanation: merged array = [1,2,3,4] and median is (2 + 3) / 2 = 2.5."}', '{"<code>nums1.length == m</code>","<code>nums2.length == n</code>","<code>0 <= m <= 1000</code>","<code>0 <= n <= 1000</code>","<code>1 <= m + n <= 2000</code>","<code>-10<sup>6</sup> <= nums1[i], nums2[i] <= 10<sup>6</sup></code>"}', '{Array,"Binary Search","Divide and Conquer"}', '{"{\"title\": \"Median of a Row Wise Sorted Matrix\", \"url\": \"https://leetcode.com/problems/median-of-a-row-wise-sorted-matrix/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.486895+08', '2022-09-09 16:01:35.486895+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (36, 'Regular Expression Matching', 'https://leetcode.com/problems/regular-expression-matching', 'hard', 'Given an input string s and a pattern p, implement regular expression matching with support for ''.'' and ''*'' where: ''.'' Matches any single character. and ''*'' Matches zero or more of the preceding element. The matching should cover the entire input string (not partial). ', '{"Input: s = \"aa\", p = \"a\"
Output: false
Explanation: \"a\" does not match the entire string \"aa\".","Input: s = \"aa\", p = \"a*\"
Output: true
Explanation: ''*'' means zero or more of the preceding element, ''a''. Therefore, by repeating ''a'' once, it becomes \"aa\".","Input: s = \"ab\", p = \".*\"
Output: true
Explanation: \".*\" means \"zero or more (*) of any character (.)\"."}', '{"<code>1 <= s.length <= 20</code>","<code>1 <= p.length <= 30</code>","<code>s</code> contains only lowercase English letters.","<code>p</code> contains only lowercase English letters, <code>''.''</code>, and <code>''*''</code>.","It is guaranteed for each appearance of the character <code>''*''</code>, there will be a previous valid character to match."}', '{String,"Dynamic Programming",Recursion}', '{"{\"title\": \"Wildcard Matching\", \"url\": \"https://leetcode.com/problems/wildcard-matching/\", \"difficulty\": \"hard\"}"}', '2022-09-09 16:01:35.487077+08', '2022-09-09 16:01:35.487077+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (37, 'Merge k Sorted Lists', 'https://leetcode.com/problems/merge-k-sorted-lists', 'hard', 'You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-list and return it. ', '{"Input: lists = [[1,4,5],[1,3,4],[2,6]]
Output: [1,1,2,3,4,4,5,6]
Explanation: The linked-lists are:
[
1->4->5,
1->3->4,
2->6
]
merging them into one sorted list:
1->1->2->3->4->4->5->6","Input: lists = []
Output: []","Input: lists = [[]]
Output: []"}', '{"<code>k == lists.length</code>","<code>0 <= k <= 10<sup>4</sup></code>","<code>0 <= lists[i].length <= 500</code>","<code>-10<sup>4</sup> <= lists[i][j] <= 10<sup>4</sup></code>","<code>lists[i]</code> is sorted in ascending order.","The sum of <code>lists[i].length</code> will not exceed <code>10<sup>4</sup></code>."}', '{"Linked List","Divide and Conquer","Heap (Priority Queue)","Merge Sort"}', '{"{\"title\": \"Merge Two Sorted Lists\", \"url\": \"https://leetcode.com/problems/merge-two-sorted-lists/\", \"difficulty\": \"easy\"}","{\"title\": \"Ugly Number II\", \"url\": \"https://leetcode.com/problems/ugly-number-ii/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.487225+08', '2022-09-09 16:01:35.487225+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (38, 'Reverse Nodes in k-Group', 'https://leetcode.com/problems/reverse-nodes-in-k-group', 'hard', 'Given the head of a linked list, reverse the nodes of the list k at a time, and return the modified list. k is a positive integer and is less than or equal to the length of the linked list. If the number of nodes is not a multiple of k then left-out nodes, in the end, should remain as it is. You may not alter the values in the list''s nodes, only nodes themselves may be changed. ', '{"Input: head = [1,2,3,4,5], k = 2
Output: [2,1,4,3,5]","Input: head = [1,2,3,4,5], k = 3
Output: [3,2,1,4,5]"}', '{"The number of nodes in the list is <code>n</code>.","<code>1 <= k <= n <= 5000</code>","<code>0 <= Node.val <= 1000</code>"}', '{"Linked List",Recursion}', '{"{\"title\": \"Swap Nodes in Pairs\", \"url\": \"https://leetcode.com/problems/swap-nodes-in-pairs/\", \"difficulty\": \"medium\"}","{\"title\": \"Swapping Nodes in a Linked List\", \"url\": \"https://leetcode.com/problems/swapping-nodes-in-a-linked-list/\", \"difficulty\": \"medium\"}","{\"title\": \"Reverse Nodes in Even Length Groups\", \"url\": \"https://leetcode.com/problems/reverse-nodes-in-even-length-groups/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.48738+08', '2022-09-09 16:01:35.48738+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (39, 'Substring with Concatenation of All Words', 'https://leetcode.com/problems/substring-with-concatenation-of-all-words', 'hard', 'You are given a string s and an array of strings words. All the strings of words are of the same length. A concatenated substring in s is a substring that contains all the strings of any permutation of words concatenated. For example, if words = ["ab","cd","ef"], then "abcdef", "abefcd", "cdabef", "cdefab", "efabcd", and "efcdab" are all concatenated strings. "acdbef" is not a concatenated substring because it is not the concatenation of any permutation of words. Return the starting indices of all the concatenated substrings in s. You can return the answer in any order. ', '{"Input: s = \"barfoothefoobarman\", words = [\"foo\",\"bar\"]
Output: [0,9]
Explanation: Since words.length == 2 and words[i].length == 3, the concatenated substring has to be of length 6.
The substring starting at 0 is \"barfoo\". It is the concatenation of [\"bar\",\"foo\"] which is a permutation of words.
The substring starting at 9 is \"foobar\". It is the concatenation of [\"foo\",\"bar\"] which is a permutation of words.
The output order does not matter. Returning [9,0] is fine too.","Input: s = \"wordgoodgoodgoodbestword\", words = [\"word\",\"good\",\"best\",\"word\"]
Output: []
Explanation: Since words.length == 4 and words[i].length == 4, the concatenated substring has to be of length 16.
There is no substring of length 16 is s that is equal to the concatenation of any permutation of words.
We return an empty array.","Input: s = \"barfoofoobarthefoobarman\", words = [\"bar\",\"foo\",\"the\"]
Output: [6,9,12]
Explanation: Since words.length == 3 and words[i].length == 3, the concatenated substring has to be of length 9.
The substring starting at 6 is \"foobarthe\". It is the concatenation of [\"foo\",\"bar\",\"the\"] which is a permutation of words.
The substring starting at 9 is \"barthefoo\". It is the concatenation of [\"bar\",\"the\",\"foo\"] which is a permutation of words.
The substring starting at 12 is \"thefoobar\". It is the concatenation of [\"the\",\"foo\",\"bar\"] which is a permutation of words."}', '{"<code>1 <= s.length <= 10<sup>4</sup></code>","<code>1 <= words.length <= 5000</code>","<code>1 <= words[i].length <= 30</code>","<code>s</code> and <code>words[i]</code> consist of lowercase English letters."}', '{"Hash Table",String,"Sliding Window"}', '{"{\"title\": \"Minimum Window Substring\", \"url\": \"https://leetcode.com/problems/minimum-window-substring/\", \"difficulty\": \"hard\"}"}', '2022-09-09 16:01:35.487517+08', '2022-09-09 16:01:35.487517+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (40, 'Longest Valid Parentheses', 'https://leetcode.com/problems/longest-valid-parentheses', 'hard', 'Given a string containing just the characters ''('' and '')'', find the length of the longest valid (well-formed) parentheses substring. ', '{"Input: s = \"(()\"
Output: 2
Explanation: The longest valid parentheses substring is \"()\".","Input: s = \")()())\"
Output: 4
Explanation: The longest valid parentheses substring is \"()()\".","Input: s = \"\"
Output: 0"}', '{"<code>0 <= s.length <= 3 * 10<sup>4</sup></code>","<code>s[i]</code> is <code>''(''</code>, or <code>'')''</code>."}', '{String,"Dynamic Programming",Stack}', '{"{\"title\": \"Valid Parentheses\", \"url\": \"https://leetcode.com/problems/valid-parentheses/\", \"difficulty\": \"easy\"}"}', '2022-09-09 16:01:35.487686+08', '2022-09-09 16:01:35.487686+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (41, 'First Missing Positive', 'https://leetcode.com/problems/first-missing-positive', 'hard', 'Given an unsorted integer array nums, return the smallest missing positive integer. You must implement an algorithm that runs in O(n) time and uses constant extra space. ', '{"Input: nums = [1,2,0]
Output: 3
Explanation: The numbers in the range [1,2] are all in the array.","Input: nums = [3,4,-1,1]
Output: 2
Explanation: 1 is in the array but 2 is missing.","Input: nums = [7,8,9,11,12]
Output: 1
Explanation: The smallest positive integer 1 is missing."}', '{"<code>1 <= nums.length <= 10<sup>5</sup></code>","<code>-2<sup>31</sup> <= nums[i] <= 2<sup>31</sup> - 1</code>"}', '{Array,"Hash Table"}', '{"{\"title\": \"Missing Number\", \"url\": \"https://leetcode.com/problems/missing-number/\", \"difficulty\": \"easy\"}","{\"title\": \"Find the Duplicate Number\", \"url\": \"https://leetcode.com/problems/find-the-duplicate-number/\", \"difficulty\": \"medium\"}","{\"title\": \"Find All Numbers Disappeared in an Array\", \"url\": \"https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/\", \"difficulty\": \"easy\"}","{\"title\": \"Couples Holding Hands\", \"url\": \"https://leetcode.com/problems/couples-holding-hands/\", \"difficulty\": \"hard\"}","{\"title\": \"Smallest Number in Infinite Set\", \"url\": \"https://leetcode.com/problems/smallest-number-in-infinite-set/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.487832+08', '2022-09-09 16:01:35.487832+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (42, 'Trapping Rain Water', 'https://leetcode.com/problems/trapping-rain-water', 'hard', 'Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. ', '{"Input: height = [0,1,0,2,1,0,1,3,2,1,2,1]
Output: 6
Explanation: The above elevation map (black section) is represented by array [0,1,0,2,1,0,1,3,2,1,2,1]. In this case, 6 units of rain water (blue section) are being trapped.","Input: height = [4,2,0,3,2,5]
Output: 9"}', '{"<code>n == height.length</code>","<code>1 <= n <= 2 * 10<sup>4</sup></code>","<code>0 <= height[i] <= 10<sup>5</sup></code>"}', '{Array,"Two Pointers","Dynamic Programming",Stack,"Monotonic Stack"}', '{"{\"title\": \"Container With Most Water\", \"url\": \"https://leetcode.com/problems/container-with-most-water/\", \"difficulty\": \"medium\"}","{\"title\": \"Product of Array Except Self\", \"url\": \"https://leetcode.com/problems/product-of-array-except-self/\", \"difficulty\": \"medium\"}","{\"title\": \"Trapping Rain Water II\", \"url\": \"https://leetcode.com/problems/trapping-rain-water-ii/\", \"difficulty\": \"hard\"}","{\"title\": \"Pour Water\", \"url\": \"https://leetcode.com/problems/pour-water/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.488053+08', '2022-09-09 16:01:35.488053+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (43, 'Wildcard Matching', 'https://leetcode.com/problems/wildcard-matching', 'hard', 'Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for ''?'' and ''*'' where: ''?'' Matches any single character. ''*'' Matches any sequence of characters (including the empty sequence). The matching should cover the entire input string (not partial). ', '{"Input: s = \"aa\", p = \"a\"
Output: false
Explanation: \"a\" does not match the entire string \"aa\".","Input: s = \"aa\", p = \"*\"
Output: true
Explanation: ''*'' matches any sequence.","Input: s = \"cb\", p = \"?a\"
Output: false
Explanation: ''?'' matches ''c'', but the second letter is ''a'', which does not match ''b''."}', '{"<code>0 <= s.length, p.length <= 2000</code>","<code>s</code> contains only lowercase English letters.","<code>p</code> contains only lowercase English letters, <code>''?''</code> or <code>''*''</code>."}', '{String,"Dynamic Programming",Greedy,Recursion}', '{"{\"title\": \"Regular Expression Matching\", \"url\": \"https://leetcode.com/problems/regular-expression-matching/\", \"difficulty\": \"hard\"}"}', '2022-09-09 16:01:35.488231+08', '2022-09-09 16:01:35.488231+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (44, 'N-Queens', 'https://leetcode.com/problems/n-queens', 'hard', 'The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-queens puzzle. You may return the answer in any order. Each solution contains a distinct board configuration of the n-queens'' placement, where ''Q'' and ''.'' both indicate a queen and an empty space, respectively. ', '{"Input: n = 4
Output: [[\".Q..\",\"...Q\",\"Q...\",\"..Q.\"],[\"..Q.\",\"Q...\",\"...Q\",\".Q..\"]]
Explanation: There exist two distinct solutions to the 4-queens puzzle as shown above","Input: n = 1
Output: [[\"Q\"]]"}', '{"<code>1 <= n <= 9</code>"}', '{Array,Backtracking}', '{"{\"title\": \"N-Queens II\", \"url\": \"https://leetcode.com/problems/n-queens-ii/\", \"difficulty\": \"hard\"}","{\"title\": \"Grid Illumination\", \"url\": \"https://leetcode.com/problems/grid-illumination/\", \"difficulty\": \"hard\"}"}', '2022-09-09 16:01:35.488373+08', '2022-09-09 16:01:35.488373+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (45, 'N-Queens II', 'https://leetcode.com/problems/n-queens-ii', 'hard', 'The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other. Given an integer n, return the number of distinct solutions to the n-queens puzzle. ', '{"Input: n = 4
Output: 2
Explanation: There are two distinct solutions to the 4-queens puzzle as shown.","Input: n = 1
Output: 1"}', '{"<code>1 <= n <= 9</code>"}', '{Backtracking}', '{"{\"title\": \"N-Queens\", \"url\": \"https://leetcode.com/problems/n-queens/\", \"difficulty\": \"hard\"}"}', '2022-09-09 16:01:35.488502+08', '2022-09-09 16:01:35.488502+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (46, 'Text Justification', 'https://leetcode.com/problems/text-justification', 'hard', 'Given an array of strings words and a width maxWidth, format the text such that each line has exactly maxWidth characters and is fully (left and right) justified. You should pack your words in a greedy approach; that is, pack as many words as you can in each line. Pad extra spaces '' '' when necessary so that each line has exactly maxWidth characters. Extra spaces between words should be distributed as evenly as possible. If the number of spaces on a line does not divide evenly between words, the empty slots on the left will be assigned more spaces than the slots on the right. For the last line of text, it should be left-justified, and no extra space is inserted between words. Note: A word is defined as a character sequence consisting of non-space characters only. Each word''s length is guaranteed to be greater than 0 and not exceed maxWidth. The input array words contains at least one word. ', '{"Input: words = [\"This\", \"is\", \"an\", \"example\", \"of\", \"text\", \"justification.\"], maxWidth = 16
Output:
[
\"This is an\",
\"example of text\",
\"justification. \"
]","Input: words = [\"What\",\"must\",\"be\",\"acknowledgment\",\"shall\",\"be\"], maxWidth = 16
Output:
[
\"What must be\",
\"acknowledgment \",
\"shall be \"
]
Explanation: Note that the last line is \"shall be \" instead of \"shall be\", because the last line must be left-justified instead of fully-justified.
Note that the second line is also left-justified because it contains only one word.","Input: words = [\"Science\",\"is\",\"what\",\"we\",\"understand\",\"well\",\"enough\",\"to\",\"explain\",\"to\",\"a\",\"computer.\",\"Art\",\"is\",\"everything\",\"else\",\"we\",\"do\"], maxWidth = 20
Output:
[
\"Science is what we\",
\"understand well\",
\"enough to explain to\",
\"a computer. Art is\",
\"everything else we\",
\"do \"
]"}', '{"<code>1 <= words.length <= 300</code>","<code>1 <= words[i].length <= 20</code>","<code>words[i]</code> consists of only English letters and symbols.","<code>1 <= maxWidth <= 100</code>","<code>words[i].length <= maxWidth</code>"}', '{Array,String,Simulation}', '{"{\"title\": \"Rearrange Spaces Between Words\", \"url\": \"https://leetcode.com/problems/rearrange-spaces-between-words/\", \"difficulty\": \"easy\"}","{\"title\": \"Divide a String Into Groups of Size k\", \"url\": \"https://leetcode.com/problems/divide-a-string-into-groups-of-size-k/\", \"difficulty\": \"easy\"}"}', '2022-09-09 16:01:35.488629+08', '2022-09-09 16:01:35.488629+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (47, 'Edit Distance', 'https://leetcode.com/problems/edit-distance', 'hard', 'Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2. You have the following three operations permitted on a word: Insert a character. Delete a character. Replace a character', '{"Input: word1 = \"horse\", word2 = \"ros\"
Output: 3
Explanation:
horse -> rorse (replace ''h'' with ''r'')
rorse -> rose (remove ''r'')
rose -> ros (remove ''e'')","Input: word1 = \"intention\", word2 = \"execution\"
Output: 5
Explanation:
intention -> inention (remove ''t'')
inention -> enention (replace ''i'' with ''e'')
enention -> exention (replace ''n'' with ''x'')
exention -> exection (replace ''n'' with ''c'')
exection -> execution (insert ''u'')"}', '{"<code>0 <= word1.length, word2.length <= 500</code>","<code>word1</code> and <code>word2</code> consist of lowercase English letters."}', '{String,"Dynamic Programming"}', '{"{\"title\": \"One Edit Distance\", \"url\": \"https://leetcode.com/problems/one-edit-distance/\", \"difficulty\": \"medium\"}","{\"title\": \"Delete Operation for Two Strings\", \"url\": \"https://leetcode.com/problems/delete-operation-for-two-strings/\", \"difficulty\": \"medium\"}","{\"title\": \"Minimum ASCII Delete Sum for Two Strings\", \"url\": \"https://leetcode.com/problems/minimum-ascii-delete-sum-for-two-strings/\", \"difficulty\": \"medium\"}","{\"title\": \"Uncrossed Lines\", \"url\": \"https://leetcode.com/problems/uncrossed-lines/\", \"difficulty\": \"medium\"}","{\"title\": \"Minimum White Tiles After Covering With Carpets\", \"url\": \"https://leetcode.com/problems/minimum-white-tiles-after-covering-with-carpets/\", \"difficulty\": \"hard\"}"}', '2022-09-09 16:01:35.488827+08', '2022-09-09 16:01:35.488827+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (48, 'Minimum Window Substring', 'https://leetcode.com/problems/minimum-window-substring', 'hard', 'Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window. If there is no such substring, return the empty string "". The testcases will be generated such that the answer is unique. A substring is a contiguous sequence of characters within the string. ', '{"Input: s = \"ADOBECODEBANC\", t = \"ABC\"
Output: \"BANC\"
Explanation: The minimum window substring \"BANC\" includes ''A'', ''B'', and ''C'' from string t.","Input: s = \"a\", t = \"a\"
Output: \"a\"
Explanation: The entire string s is the minimum window.","Input: s = \"a\", t = \"aa\"
Output: \"\"
Explanation: Both ''a''s from t must be included in the window.
Since the largest window of s only has one ''a'', return empty string."}', '{"<code>m == s.length</code>","<code>n == t.length</code>","<code>1 <= m, n <= 10<sup>5</sup></code>","<code>s</code> and <code>t</code> consist of uppercase and lowercase English letters."}', '{"Hash Table",String,"Sliding Window"}', '{"{\"title\": \"Substring with Concatenation of All Words\", \"url\": \"https://leetcode.com/problems/substring-with-concatenation-of-all-words/\", \"difficulty\": \"hard\"}","{\"title\": \"Minimum Size Subarray Sum\", \"url\": \"https://leetcode.com/problems/minimum-size-subarray-sum/\", \"difficulty\": \"medium\"}","{\"title\": \"Sliding Window Maximum\", \"url\": \"https://leetcode.com/problems/sliding-window-maximum/\", \"difficulty\": \"hard\"}","{\"title\": \"Permutation in String\", \"url\": \"https://leetcode.com/problems/permutation-in-string/\", \"difficulty\": \"medium\"}","{\"title\": \"Smallest Range Covering Elements from K Lists\", \"url\": \"https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists/\", \"difficulty\": \"hard\"}","{\"title\": \"Minimum Window Subsequence\", \"url\": \"https://leetcode.com/problems/minimum-window-subsequence/\", \"difficulty\": \"hard\"}"}', '2022-09-09 16:01:35.48902+08', '2022-09-09 16:01:35.48902+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (49, 'Largest Rectangle in Histogram', 'https://leetcode.com/problems/largest-rectangle-in-histogram', 'hard', 'Given an array of integers heights representing the histogram''s bar height where the width of each bar is 1, return the area of the largest rectangle in the histogram. ', '{"Input: heights = [2,1,5,6,2,3]
Output: 10
Explanation: The above is a histogram where width of each bar is 1.
The largest rectangle is shown in the red area, which has an area = 10 units.","Input: heights = [2,4]
Output: 4"}', '{"<code>1 <= heights.length <= 10<sup>5</sup></code>","<code>0 <= heights[i] <= 10<sup>4</sup></code>"}', '{Array,Stack,"Monotonic Stack"}', '{"{\"title\": \"Maximal Rectangle\", \"url\": \"https://leetcode.com/problems/maximal-rectangle/\", \"difficulty\": \"hard\"}","{\"title\": \"Maximum Score of a Good Subarray\", \"url\": \"https://leetcode.com/problems/maximum-score-of-a-good-subarray/\", \"difficulty\": \"hard\"}"}', '2022-09-09 16:01:35.489191+08', '2022-09-09 16:01:35.489191+08');
INSERT INTO public."Questions" (id, title, url, difficulty, prompt, examples, constraints, related_topics, similar_questions, "createdAt", "updatedAt") VALUES (50, 'Maximal Rectangle', 'https://leetcode.com/problems/maximal-rectangle', 'hard', 'Given a rows x cols binary matrix filled with 0''s and 1''s, find the largest rectangle containing only 1''s and return its area. ', '{"Input: matrix = [[\"1\",\"0\",\"1\",\"0\",\"0\"],[\"1\",\"0\",\"1\",\"1\",\"1\"],[\"1\",\"1\",\"1\",\"1\",\"1\"],[\"1\",\"0\",\"0\",\"1\",\"0\"]]
Output: 6
Explanation: The maximal rectangle is shown in the above picture.","Input: matrix = [[\"0\"]]
Output: 0","Input: matrix = [[\"1\"]]
Output: 1"}', '{"<code>rows == matrix.length</code>","<code>cols == matrix[i].length</code>","<code>1 <= row, cols <= 200</code>","<code>matrix[i][j]</code> is <code>''0''</code> or <code>''1''</code>."}', '{Array,"Dynamic Programming",Stack,Matrix,"Monotonic Stack"}', '{"{\"title\": \"Largest Rectangle in Histogram\", \"url\": \"https://leetcode.com/problems/largest-rectangle-in-histogram/\", \"difficulty\": \"hard\"}","{\"title\": \"Maximal Square\", \"url\": \"https://leetcode.com/problems/maximal-square/\", \"difficulty\": \"medium\"}"}', '2022-09-09 16:01:35.489368+08', '2022-09-09 16:01:35.489368+08');
--
-- Name: Questions_id_seq; Type: SEQUENCE SET; Schema: public; Owner: cs3219
--
SELECT pg_catalog.setval('public."Questions_id_seq"', 50, true);
--
-- PostgreSQL database dump complete
--