From 1868d921c0061611af0c0f8758cdcc03cce672fb Mon Sep 17 00:00:00 2001 From: Sean Prashad Date: Fri, 5 Jun 2020 22:55:40 -0400 Subject: [PATCH 1/3] Allow multiple patterns per question Fixes #10 --- src/components/Table/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/Table/index.js b/src/components/Table/index.js index fa32432d..ad070562 100644 --- a/src/components/Table/index.js +++ b/src/components/Table/index.js @@ -110,6 +110,11 @@ const Table = () => { { Header: 'Pattern', accessor: 'pattern', + Cell: cellInfo => ( +
+ {`${cellInfo.row.original.pattern}`.replace(/,/g, ', ')} +
+ ), Filter: SelectColumnFilter, }, { From 6efb1ec0133f74a28428e0440e8bf29570fd6f9b Mon Sep 17 00:00:00 2001 From: Sean Prashad Date: Sat, 6 Jun 2020 14:44:04 -0400 Subject: [PATCH 2/3] Convert pattern field to array This update will allow multiple patterns to be added per question. --- src/data/index.js | 349 ++++++++++++++++++++++------------------------ 1 file changed, 170 insertions(+), 179 deletions(-) diff --git a/src/data/index.js b/src/data/index.js index 54962342..7d41b025 100644 --- a/src/data/index.js +++ b/src/data/index.js @@ -3,7 +3,7 @@ const questions = [ id: 0, name: 'Contains Duplicate', url: 'https://leetcode.com/problems/contains-duplicate/', - pattern: 'Arrays', + pattern: ['Arrays'], difficulty: 'Easy', premium: false, companies: ['Amazon', 'Apple'], @@ -12,7 +12,7 @@ const questions = [ id: 1, name: 'Missing Number', url: 'https://leetcode.com/problems/missing-number/', - pattern: 'Arrays', + pattern: ['Arrays', 'Bit Manipulation'], difficulty: 'Easy', premium: false, companies: ['Amazon', 'Microsoft', 'Apple'], @@ -22,7 +22,7 @@ const questions = [ name: 'Find All Numbers Disappeared in an Array', url: 'https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/', - pattern: 'Arrays', + pattern: ['Arrays'], difficulty: 'Easy', premium: false, companies: ['Microsoft', 'Apple'], @@ -31,7 +31,7 @@ const questions = [ id: 3, name: 'Single Number', url: 'https://leetcode.com/problems/single-number/', - pattern: 'Arrays', + pattern: ['Arrays', 'Bit Manipulation'], difficulty: 'Easy', premium: false, companies: [ @@ -48,7 +48,7 @@ const questions = [ id: 4, name: 'Product of Array Except Self', url: 'https://leetcode.com/problems/product-of-array-except-self/', - pattern: 'Arrays', + pattern: ['Arrays'], difficulty: 'Medium', premium: false, companies: [ @@ -70,7 +70,7 @@ const questions = [ id: 5, name: 'Find the Duplicate Number', url: 'https://leetcode.com/problems/find-the-duplicate-number/', - pattern: 'Arrays', + pattern: ['Arrays', 'Binary Search', 'Two Pointers'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Google', 'Microsoft', 'Facebook', 'Apple'], @@ -79,7 +79,7 @@ const questions = [ id: 6, name: 'Find All Duplicates in an Array', url: 'https://leetcode.com/problems/find-all-duplicates-in-an-array/', - pattern: 'Arrays', + pattern: ['Arrays'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Microsoft', 'Facebook', 'Apple'], @@ -88,7 +88,7 @@ const questions = [ id: 7, name: 'Set Matrix Zeroes', url: 'https://leetcode.com/problems/set-matrix-zeroes/', - pattern: 'Arrays', + pattern: ['Arrays'], difficulty: 'Medium', premium: false, companies: ['Facebook', 'Amazon', 'Microsoft', 'Oracle'], @@ -97,7 +97,7 @@ const questions = [ id: 8, name: 'Spiral Matrix', url: 'https://leetcode.com/problems/spiral-matrix/', - pattern: 'Arrays', + pattern: ['Arrays'], difficulty: 'Medium', premium: false, companies: [ @@ -114,7 +114,7 @@ const questions = [ id: 9, name: 'Rotate Image', url: 'https://leetcode.com/problems/rotate-image/', - pattern: 'Arrays', + pattern: ['Arrays'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Microsoft', 'Apple', 'Facebook'], @@ -123,7 +123,7 @@ const questions = [ id: 10, name: 'Word Search', url: 'https://leetcode.com/problems/word-search/', - pattern: 'Arrays', + pattern: ['Arrays', 'Backtracking'], difficulty: 'Medium', premium: false, companies: [ @@ -143,7 +143,7 @@ const questions = [ id: 11, name: 'First Missing Positive', url: 'https://leetcode.com/problems/first-missing-positive/', - pattern: 'Arrays', + pattern: ['Arrays'], difficulty: 'Hard', premium: false, companies: [ @@ -161,7 +161,7 @@ const questions = [ id: 12, name: 'Longest Consecutive Sequence', url: 'https://leetcode.com/problems/longest-consecutive-sequence/', - pattern: 'Arrays', + pattern: ['Arrays'], difficulty: 'Hard', premium: false, companies: [ @@ -179,7 +179,7 @@ const questions = [ id: 13, name: 'Letter Case Permutation', url: 'https://leetcode.com/problems/letter-case-permutation/', - pattern: 'Backtracking', + pattern: ['Backtracking'], difficulty: 'Easy', premium: false, companies: ['Amazon'], @@ -188,7 +188,7 @@ const questions = [ id: 14, name: 'Subsets', url: 'https://leetcode.com/problems/subsets/', - pattern: 'Backtracking', + pattern: ['Backtracking'], difficulty: 'Medium', premium: false, companies: [ @@ -204,7 +204,7 @@ const questions = [ id: 15, name: 'Subsets II', url: 'https://leetcode.com/problems/subsets-ii/', - pattern: 'Backtracking', + pattern: ['Backtracking'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Bloomberg'], @@ -213,7 +213,7 @@ const questions = [ id: 16, name: 'Permutations', url: 'https://leetcode.com/problems/permutations/', - pattern: 'Backtracking', + pattern: ['Backtracking'], difficulty: 'Medium', premium: false, companies: [ @@ -233,7 +233,7 @@ const questions = [ id: 17, name: 'Permutations II', url: 'https://leetcode.com/problems/permutations-ii/', - pattern: 'Backtracking', + pattern: ['Backtracking'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Bloomberg'], @@ -242,7 +242,7 @@ const questions = [ id: 18, name: 'Combinations', url: 'https://leetcode.com/problems/combinations/', - pattern: 'Backtracking', + pattern: ['Backtracking'], difficulty: 'Medium', premium: false, companies: ['Microsoft', 'Google', 'Amazon'], @@ -251,7 +251,7 @@ const questions = [ id: 19, name: 'Combination Sum', url: 'https://leetcode.com/problems/combination-sum/', - pattern: 'Backtracking', + pattern: ['Backtracking'], difficulty: 'Medium', premium: false, companies: ['Facebook', 'Amazon', 'Microsoft', 'Airbnb', 'Uber'], @@ -260,7 +260,7 @@ const questions = [ id: 20, name: 'Combination Sum II', url: 'https://leetcode.com/problems/combination-sum-ii/', - pattern: 'Backtracking', + pattern: ['Backtracking'], difficulty: 'Medium', premium: false, companies: ['Google', 'Microsoft', 'Amazon'], @@ -269,7 +269,7 @@ const questions = [ id: 21, name: 'Combination Sum III', url: 'https://leetcode.com/problems/combination-sum-iii/', - pattern: 'Backtracking', + pattern: ['Backtracking'], difficulty: 'Medium', premium: false, companies: ['Microsoft', 'Amazon'], @@ -278,7 +278,7 @@ const questions = [ id: 22, name: 'Generate Parentheses', url: 'https://leetcode.com/problems/generate-parentheses/', - pattern: 'Backtracking', + pattern: ['Backtracking'], difficulty: 'Medium', premium: false, companies: [ @@ -295,7 +295,7 @@ const questions = [ id: 23, name: 'Target Sum', url: 'https://leetcode.com/problems/target-sum/', - pattern: 'DFS', + pattern: ['DFS', 'Dynamic Programming'], difficulty: 'Medium', premium: false, companies: ['Facebook'], @@ -304,7 +304,7 @@ const questions = [ id: 24, name: 'Palindrome Partitioning', url: 'https://leetcode.com/problems/palindrome-partitioning/', - pattern: 'Backtracking', + pattern: ['Backtracking'], difficulty: 'Medium', premium: false, companies: ['Amazon'], @@ -313,7 +313,7 @@ const questions = [ id: 25, name: 'Letter Combinations of a Phone Number', url: 'https://leetcode.com/problems/letter-combinations-of-a-phone-number/', - pattern: 'Backtracking', + pattern: ['Backtracking'], difficulty: 'Medium', premium: false, companies: [ @@ -333,7 +333,7 @@ const questions = [ id: 26, name: 'Generalized Abbreviation', url: 'https://leetcode.com/problems/generalized-abbreviation/', - pattern: 'Backtracking', + pattern: ['Backtracking'], difficulty: 'Medium', premium: true, companies: ['Google'], @@ -342,7 +342,7 @@ const questions = [ id: 27, name: 'Sudoku Solver', url: 'https://leetcode.com/problems/sudoku-solver/', - pattern: 'Backtracking', + pattern: ['Backtracking'], difficulty: 'Hard', premium: false, companies: ['Microsoft', 'Amazon', 'Apple', 'Oracle'], @@ -351,7 +351,7 @@ const questions = [ id: 28, name: 'N-Queens', url: 'https://leetcode.com/problems/n-queens/', - pattern: 'Backtracking', + pattern: ['Backtracking'], difficulty: 'Hard', premium: false, companies: ['Apple', 'Oracle', 'Amazon'], @@ -360,7 +360,7 @@ const questions = [ id: 29, name: 'Climbing Stairs', url: 'https://leetcode.com/problems/climbing-stairs/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Easy', premium: false, companies: [ @@ -378,7 +378,7 @@ const questions = [ id: 30, name: 'House Robber', url: 'https://leetcode.com/problems/house-robber/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Easy', premium: false, companies: ['Google', 'Apple', 'Adobe', 'Microsoft', 'Amazon'], @@ -387,7 +387,7 @@ const questions = [ id: 31, name: 'Best Time to Buy and Sell Stock', url: 'https://leetcode.com/problems/best-time-to-buy-and-sell-stock/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Easy', premium: false, companies: [ @@ -408,7 +408,7 @@ const questions = [ id: 32, name: 'Maximum Subarray', url: 'https://leetcode.com/problems/maximum-subarray/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Easy', premium: false, companies: [ @@ -429,7 +429,7 @@ const questions = [ id: 33, name: 'Range Sum Query - Immutable', url: 'https://leetcode.com/problems/range-sum-query-immutable/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Easy', premium: false, companies: ['Google', 'Facebook'], @@ -438,7 +438,7 @@ const questions = [ id: 34, name: 'House Robber II', url: 'https://leetcode.com/problems/house-robber-ii/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Medium', premium: false, companies: ['Google'], @@ -447,7 +447,7 @@ const questions = [ id: 35, name: 'Coin Change', url: 'https://leetcode.com/problems/coin-change/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Medium', premium: false, companies: [ @@ -466,7 +466,7 @@ const questions = [ id: 36, name: 'Maximum Product Subarray', url: 'https://leetcode.com/problems/maximum-product-subarray/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Medium', premium: false, companies: [ @@ -482,7 +482,7 @@ const questions = [ id: 37, name: 'Longest Increasing Subsequence', url: 'https://leetcode.com/problems/longest-increasing-subsequence/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Medium', premium: false, companies: [ @@ -499,7 +499,7 @@ const questions = [ id: 38, name: 'Longest Palindromic Substring', url: 'https://leetcode.com/problems/longest-palindromic-substring/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Medium', premium: false, companies: [ @@ -518,7 +518,7 @@ const questions = [ id: 39, name: 'Word Break', url: 'https://leetcode.com/problems/word-break/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Medium', premium: false, companies: [ @@ -538,7 +538,7 @@ const questions = [ id: 40, name: 'Combination Sum IV', url: 'https://leetcode.com/problems/combination-sum-iv/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Medium', premium: false, companies: ['Google'], @@ -547,7 +547,7 @@ const questions = [ id: 41, name: 'Decode Ways', url: 'https://leetcode.com/problems/decode-ways/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Medium', premium: false, companies: [ @@ -565,7 +565,7 @@ const questions = [ id: 42, name: 'Unique Paths', url: 'https://leetcode.com/problems/unique-paths/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Medium', premium: false, companies: [ @@ -583,7 +583,7 @@ const questions = [ id: 43, name: 'Jump Game', url: 'https://leetcode.com/problems/jump-game/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming', 'Greedy'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Facebook', 'Adobe', 'Google', 'Bloomberg', 'Oracle'], @@ -592,7 +592,7 @@ const questions = [ id: 44, name: 'Palindromic Substrings', url: 'https://leetcode.com/problems/palindromic-substrings/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Medium', premium: false, companies: ['Facebook', 'Amazon', 'Apple', 'Twitter', 'Google', 'Citadel'], @@ -602,7 +602,7 @@ const questions = [ name: 'Number of Longest Increasing Subsequence', url: 'https://leetcode.com/problems/number-of-longest-increasing-subsequence/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Medium', premium: false, companies: ['Facebook', 'Amazon'], @@ -611,7 +611,7 @@ const questions = [ id: 46, name: 'Partition Equal Subset Sum', url: 'https://leetcode.com/problems/partition-equal-subset-sum/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Medium', premium: false, companies: ['Facebook'], @@ -620,7 +620,7 @@ const questions = [ id: 47, name: 'Partition to K Equal Sum Subsets', url: 'https://leetcode.com/problems/partition-to-k-equal-sum-subsets/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Medium', premium: false, companies: ['LinkedIn', 'Amazon', 'Facebook'], @@ -630,7 +630,7 @@ const questions = [ name: 'Best Time to Buy and Sell Stock with Cooldown', url: 'https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Medium', premium: false, companies: ['Google', 'Amazon', 'Apple'], @@ -639,7 +639,7 @@ const questions = [ id: 49, name: 'Counting Bits', url: 'https://leetcode.com/problems/counting-bits/', - pattern: 'Dynamic Programming', + pattern: ['Dynamic Programming'], difficulty: 'Medium', premium: false, companies: ['Facebook'], @@ -648,7 +648,7 @@ const questions = [ id: 50, name: 'Linked List Cycle', url: 'https://leetcode.com/problems/linked-list-cycle/', - pattern: 'Fast & Slow Pointers', + pattern: ['Fast & Slow Pointers'], difficulty: 'Easy', premium: false, companies: ['Amazon', 'Apple', 'Microsoft', 'Goldman Sachs'], @@ -657,7 +657,7 @@ const questions = [ id: 51, name: 'Middle of the Linked List', url: 'https://leetcode.com/problems/middle-of-the-linked-list/', - pattern: 'Fast & Slow Pointers', + pattern: ['Fast & Slow Pointers'], difficulty: 'Easy', premium: false, companies: ['Amazon', 'Apple', 'Oracle'], @@ -666,7 +666,7 @@ const questions = [ id: 52, name: 'Palindrome Linked List', url: 'https://leetcode.com/problems/palindrome-linked-list/', - pattern: 'Fast & Slow Pointers', + pattern: ['Fast & Slow Pointers'], difficulty: 'Easy', premium: false, companies: ['Amazon', 'Microsoft', 'Apple', 'Snapchat', 'Bloomberg'], @@ -675,7 +675,7 @@ const questions = [ id: 53, name: 'Remove Linked List Elements', url: 'https://leetcode.com/problems/remove-linked-list-elements/', - pattern: 'Fast & Slow Pointers', + pattern: ['Fast & Slow Pointers'], difficulty: 'Easy', premium: false, companies: ['Bloomberg', 'Google', 'Capital One'], @@ -684,7 +684,7 @@ const questions = [ id: 54, name: 'Remove Duplicates from Sorted List', url: 'https://leetcode.com/problems/remove-duplicates-from-sorted-list/', - pattern: 'Fast & Slow Pointers', + pattern: ['Fast & Slow Pointers'], difficulty: 'Easy', premium: false, companies: ['Amazon', 'Apple', 'Microsoft'], @@ -693,7 +693,7 @@ const questions = [ id: 55, name: 'Linked List Cycle II', url: 'https://leetcode.com/problems/linked-list-cycle-ii/', - pattern: 'Fast & Slow Pointers', + pattern: ['Fast & Slow Pointers'], difficulty: 'Medium', premium: false, companies: ['Microsoft', 'Apple', 'Adobe'], @@ -702,7 +702,7 @@ const questions = [ id: 56, name: 'Add Two Numbers', url: 'https://leetcode.com/problems/add-two-numbers/', - pattern: 'Fast & Slow Pointers', + pattern: ['Fast & Slow Pointers'], difficulty: 'Medium', premium: false, companies: [ @@ -721,7 +721,7 @@ const questions = [ id: 57, name: 'Remove Nth Node From End Of List', url: 'https://leetcode.com/problems/remove-nth-node-from-end-of-list/', - pattern: 'Fast & Slow Pointers', + pattern: ['Fast & Slow Pointers'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Facebook', 'Microsoft'], @@ -730,7 +730,7 @@ const questions = [ id: 58, name: 'Sort List', url: 'https://leetcode.com/problems/sort-list/', - pattern: 'Fast & Slow Pointers', + pattern: ['Fast & Slow Pointers'], difficulty: 'Medium', premium: false, companies: ['Microsoft', 'Amazon', 'Facebook'], @@ -739,7 +739,7 @@ const questions = [ id: 59, name: 'Reorder List', url: 'https://leetcode.com/problems/reorder-list/', - pattern: 'Fast & Slow Pointers', + pattern: ['Fast & Slow Pointers'], difficulty: 'Medium', premium: false, companies: ['Facebook', 'Amazon', 'Microsoft'], @@ -748,7 +748,7 @@ const questions = [ id: 60, name: 'Clone Graph', url: 'https://leetcode.com/problems/clone-graph/', - pattern: 'Graphs', + pattern: ['BFS', 'DFS', 'Graph'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Facebook', 'Microsoft'], @@ -757,7 +757,7 @@ const questions = [ id: 62, name: 'Pacific Atlantic Water Flow', url: 'https://leetcode.com/problems/pacific-atlantic-water-flow/', - pattern: 'Graphs', + pattern: ['BFS', 'DFS'], difficulty: 'Medium', premium: false, companies: ['Microsoft', 'Google', 'Amazon'], @@ -766,7 +766,7 @@ const questions = [ id: 63, name: 'Number of Islands', url: 'https://leetcode.com/problems/number-of-islands/', - pattern: 'Graphs', + pattern: ['BFS', 'DFS', 'Union Find'], difficulty: 'Medium', premium: false, companies: [ @@ -785,7 +785,7 @@ const questions = [ id: 64, name: 'Graph Valid Tree', url: 'https://leetcode.com/problems/graph-valid-tree/', - pattern: 'Graphs', + pattern: ['BFS', 'DFS', 'Graph', 'Union Find'], difficulty: 'Medium', premium: true, companies: ['Amazon', 'LinkedIn'], @@ -795,7 +795,7 @@ const questions = [ name: 'Number of Connected Components in an Undirected Graph', url: 'https://leetcode.com/problems/number-of-connected-components-in-an-undirected-graph/', - pattern: 'Graphs', + pattern: ['BFS', 'DFS', 'Graph', 'Union Find'], difficulty: 'Medium', premium: true, companies: ['Facebook', 'Amazon'], @@ -804,7 +804,7 @@ const questions = [ id: 66, name: 'Reverse Linked List', url: 'https://leetcode.com/problems/reverse-linked-list/', - pattern: 'In-place reversal of a linked list', + pattern: ['In-place reversal of a linked list'], difficulty: 'Easy', premium: false, companies: [ @@ -822,7 +822,7 @@ const questions = [ id: 67, name: 'Reverse Linked List II', url: 'https://leetcode.com/problems/reverse-linked-list-ii/', - pattern: 'In-place reversal of a linked list', + pattern: ['In-place reversal of a linked list'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Facebook', 'Microsoft', 'Oracle'], @@ -831,7 +831,7 @@ const questions = [ id: 68, name: 'Rotate List', url: 'https://leetcode.com/problems/rotate-list/', - pattern: 'In-place reversal of a linked list', + pattern: ['In-place reversal of a linked list'], difficulty: 'Medium', premium: false, companies: ['LinkedIn', 'Amazon', 'Microsoft'], @@ -840,7 +840,7 @@ const questions = [ id: 69, name: 'Swap Nodes in Pairs', url: 'https://leetcode.com/problems/swap-nodes-in-pairs/', - pattern: 'In-place reversal of a linked list', + pattern: ['In-place reversal of a linked list'], difficulty: 'Medium', premium: false, companies: ['Microsoft', 'Facebook', 'Apple', 'Amazon'], @@ -849,7 +849,7 @@ const questions = [ id: 70, name: 'Odd Even Linked List', url: 'https://leetcode.com/problems/odd-even-linked-list/', - pattern: 'In-place reversal of a linked list', + pattern: ['In-place reversal of a linked list'], difficulty: 'Medium', premium: false, companies: ['Capital One', 'Facebook', 'Google', 'Microsoft', 'Bloomberg'], @@ -858,7 +858,7 @@ const questions = [ id: 71, name: 'Reverse Nodes in k-Group', url: 'https://leetcode.com/problems/reverse-nodes-in-k-group/', - pattern: 'In-place reversal of a linked list', + pattern: ['In-place reversal of a linked list'], difficulty: 'Hard', premium: false, companies: ['Microsoft', 'Amazon', 'Facebook', 'Apple', 'Adobe'], @@ -867,7 +867,7 @@ const questions = [ id: 72, name: 'Merge Two Sorted Lists', url: 'https://leetcode.com/problems/merge-two-sorted-lists/', - pattern: 'K-Way Merge', + pattern: ['K-Way Merge'], difficulty: 'Easy', premium: false, companies: [ @@ -888,7 +888,7 @@ const questions = [ name: 'Kth Smallest Element in a Sorted Matrix', url: 'https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/', - pattern: 'K-Way Merge', + pattern: ['Binary Search', 'Heap'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Facebook', 'Microsoft', 'Google'], @@ -897,7 +897,7 @@ const questions = [ id: 74, name: 'Find K Pairs with Smallest Sums', url: 'https://leetcode.com/problems/find-k-pairs-with-smallest-sums/', - pattern: 'K-Way Merge', + pattern: ['Heap'], difficulty: 'Medium', premium: false, companies: ['LinkedIn', 'Amazon', 'Facebook'], @@ -906,7 +906,7 @@ const questions = [ id: 75, name: 'Merge k Sorted Lists', url: 'https://leetcode.com/problems/merge-k-sorted-lists/', - pattern: 'K-Way Merge', + pattern: ['Heap'], difficulty: 'Hard', premium: false, companies: [ @@ -926,7 +926,7 @@ const questions = [ name: 'Smallest Range Covering Elements from K Lists', url: 'https://leetcode.com/problems/smallest-range-covering-elements-from-k-lists/', - pattern: 'K-Way Merge', + pattern: ['Heap'], difficulty: 'Hard', premium: false, companies: ['Google', 'Amazon', 'Snapchat'], @@ -935,7 +935,7 @@ const questions = [ id: 77, name: 'Meeting Rooms', url: 'https://leetcode.com/problems/meeting-rooms', - pattern: 'Merge Intervals', + pattern: ['Intervals'], difficulty: 'Easy', premium: true, companies: ['Microsoft'], @@ -944,7 +944,7 @@ const questions = [ id: 78, name: 'Merge Intervals', url: 'https://leetcode.com/problems/merge-intervals/', - pattern: 'Merge Intervals', + pattern: ['Intervals'], difficulty: 'Medium', premium: false, companies: [ @@ -967,7 +967,7 @@ const questions = [ id: 79, name: 'Interval List Intersections', url: 'https://leetcode.com/problems/interval-list-intersections/', - pattern: 'Merge Intervals', + pattern: ['Intervals'], difficulty: 'Medium', premium: false, companies: [ @@ -984,7 +984,7 @@ const questions = [ id: 80, name: 'Non-overlapping Intervals', url: 'https://leetcode.com/problems/non-overlapping-intervals/', - pattern: 'Merge Intervals', + pattern: ['Intervals'], difficulty: 'Medium', premium: false, companies: ['Facebook'], @@ -993,7 +993,7 @@ const questions = [ id: 81, name: 'Meeting Rooms II', url: 'https://leetcode.com/problems/meeting-rooms-ii/', - pattern: 'Merge Intervals', + pattern: ['Heap', 'Intervals'], difficulty: 'Medium', premium: true, companies: [ @@ -1012,7 +1012,7 @@ const questions = [ id: 82, name: 'Task Scheduler', url: 'https://leetcode.com/problems/task-scheduler/', - pattern: 'Merge Intervals', + pattern: ['Greedy', 'Heap'], difficulty: 'Medium', premium: false, companies: ['Facebook', 'Microsoft', 'Amazon', 'Uber', 'Oracle'], @@ -1022,7 +1022,7 @@ const questions = [ name: 'Minimum Number of Arrows to Burst Balloons', url: 'https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/', - pattern: 'Merge Intervals', + pattern: ['Greedy'], difficulty: 'Medium', premium: false, companies: ['Facebook'], @@ -1031,7 +1031,7 @@ const questions = [ id: 84, name: 'Insert Interval', url: 'https://leetcode.com/problems/insert-interval/', - pattern: 'Merge Intervals', + pattern: ['Intervals'], difficulty: 'Hard', premium: false, companies: ['Google', 'Facebook', 'Twitter', 'Uber', 'LinkedIn', 'Amazon'], @@ -1040,7 +1040,7 @@ const questions = [ id: 85, name: 'Employee Free Time', url: 'https://leetcode.com/problems/employee-free-time/', - pattern: 'Merge Intervals', + pattern: ['Heap', 'Greedy'], difficulty: 'Hard', premium: true, companies: [ @@ -1056,7 +1056,7 @@ const questions = [ id: 86, name: 'Binary Search', url: 'https://leetcode.com/problems/binary-search/', - pattern: 'Modified Binary Search', + pattern: ['Modified Binary Search'], difficulty: 'Easy', premium: false, companies: ['Microsoft'], @@ -1066,7 +1066,7 @@ const questions = [ name: 'Find Smallest Letter Greater Than Target', url: 'https://leetcode.com/problems/find-smallest-letter-greater-than-target/', - pattern: 'Modified Binary Search', + pattern: ['Modified Binary Search'], difficulty: 'Easy', premium: false, companies: ['LinkedIn'], @@ -1075,7 +1075,7 @@ const questions = [ id: 88, name: 'Peak Index in a Mountain Array', url: 'https://leetcode.com/problems/peak-index-in-a-mountain-array/', - pattern: 'Modified Binary Search', + pattern: ['Modified Binary Search'], difficulty: 'Easy', premium: false, companies: ['Facebook', 'Amazon', 'Google', 'Uber'], @@ -1084,7 +1084,7 @@ const questions = [ id: 89, name: 'Find Minimum in Rotated Sorted Array', url: 'https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/', - pattern: 'Modified Binary Search', + pattern: ['Modified Binary Search'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Microsoft', 'Google', 'Goldman Sachs', 'Apple'], @@ -1093,7 +1093,7 @@ const questions = [ id: 90, name: 'Find Peak Element', url: 'https://leetcode.com/problems/find-peak-element/', - pattern: 'Modified Binary Search', + pattern: ['Modified Binary Search'], difficulty: 'Medium', premium: false, companies: ['Facebook', 'Amazon', 'Google', 'Apple'], @@ -1102,7 +1102,7 @@ const questions = [ id: 91, name: 'Search in Rotated Sorted Array', url: 'https://leetcode.com/problems/search-in-rotated-sorted-array/', - pattern: 'Modified Binary Search', + pattern: ['Modified Binary Search'], difficulty: 'Medium', premium: false, companies: [ @@ -1121,7 +1121,7 @@ const questions = [ id: 92, name: 'Search in Rotated Sorted Array II', url: 'https://leetcode.com/problems/search-in-rotated-sorted-array-ii/', - pattern: 'Modified Binary Search', + pattern: ['Modified Binary Search'], difficulty: 'Medium', premium: false, companies: ['Amazon'], @@ -1130,7 +1130,7 @@ const questions = [ id: 93, name: 'Search a 2D Matrix', url: 'https://leetcode.com/problems/search-a-2d-matrix/', - pattern: 'Modified Binary Search', + pattern: ['Modified Binary Search'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Microsoft', 'Facebook', 'Uber', 'Apple'], @@ -1139,7 +1139,7 @@ const questions = [ id: 94, name: 'Search a 2D Matrix II', url: 'https://leetcode.com/problems/search-a-2d-matrix-ii/', - pattern: 'Modified Binary Search', + pattern: ['Modified Binary Search'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Facebook', 'Microsoft'], @@ -1148,7 +1148,7 @@ const questions = [ id: 95, name: 'Find K Closest Elements', url: 'https://leetcode.com/problems/find-k-closest-elements/', - pattern: 'Modified Binary Search', + pattern: ['Modified Binary Search'], difficulty: 'Medium', premium: false, companies: ['Facebook', 'Bloomberg', 'Apple'], @@ -1157,7 +1157,7 @@ const questions = [ id: 96, name: 'Count of Range Sum', url: 'https://leetcode.com/problems/count-of-range-sum/', - pattern: 'Modified Binary Search', + pattern: ['Modified Binary Search'], difficulty: 'Hard', premium: false, companies: ['Google'], @@ -1166,7 +1166,7 @@ const questions = [ id: 97, name: 'Minimum Size Subarray Sum', url: 'https://leetcode.com/problems/minimum-size-subarray-sum/', - pattern: 'Sliding Window', + pattern: ['Sliding Window'], difficulty: 'Medium', premium: false, companies: ['Goldman Sachs', 'Google', 'Amazon', 'Facebook', 'Oracle'], @@ -1175,7 +1175,7 @@ const questions = [ id: 98, name: 'Fruit Into Baskets', url: 'https://leetcode.com/problems/fruit-into-baskets/', - pattern: 'Sliding Window', + pattern: ['Sliding Window'], difficulty: 'Medium', premium: false, companies: ['Google'], @@ -1184,7 +1184,7 @@ const questions = [ id: 99, name: 'Permutation in String', url: 'https://leetcode.com/problems/permutation-in-string/', - pattern: 'Sliding Window', + pattern: ['Sliding Window'], difficulty: 'Medium', premium: false, companies: ['Facebook', 'Microsoft', 'Google'], @@ -1194,7 +1194,7 @@ const questions = [ name: 'Longest Repeating Character Replacement', url: 'https://leetcode.com/problems/longest-repeating-character-replacement/', - pattern: 'Sliding Window', + pattern: ['Sliding Window'], difficulty: 'Medium', premium: false, companies: ['Google'], @@ -1203,7 +1203,7 @@ const questions = [ id: 101, name: 'Sliding Window Maximum', url: 'https://leetcode.com/problems/sliding-window-maximum/', - pattern: 'Sliding Window', + pattern: ['Sliding Window'], difficulty: 'Hard', premium: false, companies: [ @@ -1222,7 +1222,7 @@ const questions = [ name: 'Longest Substring Without Repeating Characters', url: 'https://leetcode.com/problems/longest-substring-without-repeating-characters/', - pattern: 'Sliding Window', + pattern: ['Sliding Window'], difficulty: 'Hard', premium: false, companies: [ @@ -1242,7 +1242,7 @@ const questions = [ name: 'Minimum Number of K Consecutive Bit Flips', url: 'https://leetcode.com/problems/minimum-number-of-k-consecutive-bit-flips/', - pattern: 'Sliding Window', + pattern: ['Sliding Window'], difficulty: 'Hard', premium: false, companies: ['Amazon'], @@ -1252,7 +1252,7 @@ const questions = [ name: 'Count Unique Characters of All Substrings of a Given String', url: 'https://leetcode.com/problems/count-unique-characters-of-all-substrings-of-a-given-string/', - pattern: 'Sliding Window', + pattern: ['Sliding Window'], difficulty: 'Hard', premium: false, companies: ['Twitch'], @@ -1261,7 +1261,7 @@ const questions = [ id: 105, name: 'Minimum Window Substring', url: 'https://leetcode.com/problems/minimum-window-substring/', - pattern: 'Sliding Window', + pattern: ['Sliding Window'], difficulty: 'Hard', premium: false, companies: [ @@ -1283,7 +1283,7 @@ const questions = [ name: 'Substring with Concatenation of All Words', url: 'https://leetcode.com/problems/substring-with-concatenation-of-all-words/', - pattern: 'Sliding Window', + pattern: ['Sliding Window'], difficulty: 'Hard', premium: false, companies: ['Amazon', 'Microsoft', 'Google', 'Facebook'], @@ -1292,7 +1292,7 @@ const questions = [ id: 107, name: 'Kth Smallest Element in a BST', url: 'https://leetcode.com/problems/kth-smallest-element-in-a-bst/', - pattern: "Top 'K' Elements", + pattern: ['DFS', "Top 'K' Elements"], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Oracle', 'Facebook', 'Apple', 'Bloomberg'], @@ -1301,7 +1301,7 @@ const questions = [ id: 108, name: 'K Closest Points to Origin', url: 'https://leetcode.com/problems/k-closest-points-to-origin/', - pattern: "Top 'K' Elements", + pattern: ['Heap', "Top 'K' Elements"], difficulty: 'Medium', premium: false, companies: ['Facebook', 'Amazon', 'Asana', 'Oracle', 'Apple'], @@ -1310,7 +1310,7 @@ const questions = [ id: 109, name: 'Top K Frequent Elements', url: 'https://leetcode.com/problems/top-k-frequent-elements/', - pattern: "Top 'K' Elements", + pattern: ['Heap', "Top 'K' Elements"], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Facebook', 'Oracle', 'Google', 'Yelp', 'Apple'], @@ -1319,7 +1319,7 @@ const questions = [ id: 110, name: 'Sort Characters By Frequency', url: 'https://leetcode.com/problems/sort-characters-by-frequency/', - pattern: "Top 'K' Elements", + pattern: ['Heap', "Top 'K' Elements"], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Bloomberg', 'Uber'], @@ -1328,7 +1328,7 @@ const questions = [ id: 111, name: 'Kth Largest Element in an Array', url: 'https://leetcode.com/problems/kth-largest-element-in-an-array/', - pattern: "Top 'K' Elements", + pattern: ['Heap', "Top 'K' Elements"], difficulty: 'Medium', premium: false, companies: [ @@ -1349,7 +1349,7 @@ const questions = [ id: 112, name: 'Reorganize String', url: 'https://leetcode.com/problems/reorganize-string/', - pattern: "Top 'K' Elements", + pattern: ['Greedy', 'Heap', "Top 'K' Elements"], difficulty: 'Medium', premium: false, companies: [ @@ -1365,7 +1365,7 @@ const questions = [ id: 113, name: 'Rearrange String k Distance Apart', url: 'https://leetcode.com/problems/rearrange-string-k-distance-apart', - pattern: "Top 'K' Elements", + pattern: ['Greedy', 'Heap', "Top 'K' Elements"], difficulty: 'Hard', premium: true, companies: ['Google'], @@ -1374,7 +1374,7 @@ const questions = [ id: 114, name: 'Course Schedule III', url: 'https://leetcode.com/problems/course-schedule-iii/', - pattern: "Top 'K' Elements", + pattern: ['Greedy', 'Heap'], difficulty: 'Hard', premium: false, companies: ['Microsoft'], @@ -1383,7 +1383,7 @@ const questions = [ id: 115, name: 'Maximum Frequency Stack', url: 'https://leetcode.com/problems/maximum-frequency-stack/', - pattern: "Top 'K' Elements", + pattern: ['Bucket Sort', 'Heap'], difficulty: 'Hard', premium: false, companies: ['Amazon', 'Apple'], @@ -1392,7 +1392,7 @@ const questions = [ id: 116, name: 'Course Schedule', url: 'https://leetcode.com/problems/course-schedule/', - pattern: 'Topological Sort', + pattern: ['BFS', 'DFS', 'Graph', 'Topological Sort'], difficulty: 'Medium', premium: false, companies: ['Microsoft', 'Amazon', 'Facebook', 'Oracle', 'Google', 'Apple'], @@ -1401,7 +1401,7 @@ const questions = [ id: 117, name: 'Course Schedule II', url: 'https://leetcode.com/problems/course-schedule-ii/', - pattern: 'Topological Sort', + pattern: ['BFS', 'DFS', 'Graph', 'Topological Sort'], difficulty: 'Medium', premium: false, companies: [ @@ -1420,7 +1420,7 @@ const questions = [ id: 118, name: 'Minimum Height Trees', url: 'https://leetcode.com/problems/minimum-height-trees/', - pattern: 'Topological Sort', + pattern: ['BFS', 'Graph', 'Topological Sort'], difficulty: 'Medium', premium: false, companies: ['Google', 'Amazon'], @@ -1429,7 +1429,7 @@ const questions = [ id: 119, name: 'Alien Dictionary', url: 'https://leetcode.com/problems/alien-dictionary', - pattern: 'Topological Sort', + pattern: ['Graph', 'Topological Sort'], difficulty: 'Hard', premium: true, companies: [ @@ -1448,7 +1448,7 @@ const questions = [ id: 120, name: 'Sequence Reconstruction', url: 'https://leetcode.com/problems/sequence-reconstruction', - pattern: 'Topological Sort', + pattern: ['Graph', 'Topological Sort'], difficulty: 'Hard', premium: true, companies: ['Google'], @@ -1457,7 +1457,7 @@ const questions = [ id: 121, name: 'Binary Tree Level Order Traversal II', url: 'https://leetcode.com/problems/binary-tree-level-order-traversal-ii/', - pattern: 'BFS', + pattern: ['BFS'], difficulty: 'Easy', premium: false, companies: ['Apple'], @@ -1466,7 +1466,7 @@ const questions = [ id: 122, name: 'Average of Levels in Binary Tree', url: 'https://leetcode.com/problems/average-of-levels-in-binary-tree/', - pattern: 'BFS', + pattern: ['BFS'], difficulty: 'Easy', premium: false, companies: ['Amazon', 'Facebook'], @@ -1475,7 +1475,7 @@ const questions = [ id: 123, name: 'Minimum Depth of Binary Tree', url: 'https://leetcode.com/problems/minimum-depth-of-binary-tree/', - pattern: 'BFS', + pattern: ['BFS', 'DFS'], difficulty: 'Easy', premium: false, companies: ['Facebook'], @@ -1484,7 +1484,7 @@ const questions = [ id: 124, name: 'Binary Tree Level Order Traversal', url: 'https://leetcode.com/problems/binary-tree-level-order-traversal/', - pattern: 'BFS', + pattern: ['BFS'], difficulty: 'Medium', premium: false, companies: [ @@ -1501,7 +1501,7 @@ const questions = [ name: 'Binary Tree Zigzag Level Order Traversal', url: 'https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/', - pattern: 'BFS', + pattern: ['BFS'], difficulty: 'Medium', premium: false, companies: [ @@ -1519,7 +1519,7 @@ const questions = [ name: 'Populating Next Right Pointers in Each Node', url: 'https://leetcode.com/problems/populating-next-right-pointers-in-each-node/', - pattern: 'BFS', + pattern: ['BFS'], difficulty: 'Medium', premium: false, companies: [ @@ -1536,7 +1536,7 @@ const questions = [ name: 'Populating Next Right Pointers in Each Node II', url: 'https://leetcode.com/problems/populating-next-right-pointers-in-each-node-ii/', - pattern: 'BFS', + pattern: ['BFS'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Microsoft', 'Bloomberg', 'Facebook', 'Google'], @@ -1545,7 +1545,7 @@ const questions = [ id: 128, name: 'Binary Tree Right Side View', url: 'https://leetcode.com/problems/binary-tree-right-side-view/', - pattern: 'BFS', + pattern: ['BFS', 'DFS'], difficulty: 'Medium', premium: false, companies: ['Facebook', 'Amazon', 'Microsoft', 'Bloomberg'], @@ -1554,25 +1554,16 @@ const questions = [ id: 129, name: 'All Nodes Distance K in Binary Tree', url: 'https://leetcode.com/problems/all-nodes-distance-k-in-binary-tree/', - pattern: 'BFS', + pattern: ['BFS', 'DFS'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Facebook', 'Microsoft', 'Uber'], }, - { - id: 130, - name: 'Boundary of Binary Tree', - url: 'https://leetcode.com/problems/boundary-of-binary-tree', - pattern: 'BFS', - difficulty: 'Medium', - premium: true, - companies: ['Amazon', 'Microsoft', 'Apple', 'Oracle'], - }, { id: 131, name: 'Same Tree', url: 'https://leetcode.com/problems/same-tree/', - pattern: 'DFS', + pattern: ['DFS'], difficulty: 'Easy', premium: false, companies: ['Amazon'], @@ -1581,7 +1572,7 @@ const questions = [ id: 132, name: 'Path Sum', url: 'https://leetcode.com/problems/path-sum/', - pattern: 'DFS', + pattern: ['DFS'], difficulty: 'Easy', premium: false, companies: ['Amazon', 'Facebook', 'Bloomberg'], @@ -1590,7 +1581,7 @@ const questions = [ id: 133, name: 'Diameter of Binary Tree', url: 'https://leetcode.com/problems/diameter-of-binary-tree/', - pattern: 'DFS', + pattern: ['DFS'], difficulty: 'Easy', premium: false, companies: ['Facebook', 'Amazon', 'Microsoft', 'Oracle', 'Google', 'Adobe'], @@ -1599,7 +1590,7 @@ const questions = [ id: 134, name: 'Merge Two Binary Trees', url: 'https://leetcode.com/problems/merge-two-binary-trees/', - pattern: 'DFS', + pattern: ['DFS'], difficulty: 'Easy', premium: false, companies: ['Adobe', 'Amazon'], @@ -1608,7 +1599,7 @@ const questions = [ id: 135, name: 'Maximum Depth of Binary Tree', url: 'https://leetcode.com/problems/maximum-depth-of-binary-tree/', - pattern: 'DFS', + pattern: ['DFS'], difficulty: 'Easy', premium: false, companies: ['Amazon', 'Microsoft', 'Google', 'Goldman Sachs'], @@ -1618,7 +1609,7 @@ const questions = [ name: 'Lowest Common Ancestor of a Binary Search Tree', url: 'https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/', - pattern: 'DFS', + pattern: ['DFS'], difficulty: 'Easy', premium: false, companies: ['Amazon', 'Facebook', 'Microsoft', 'LinkedIn'], @@ -1627,7 +1618,7 @@ const questions = [ id: 137, name: 'Subtree of Another Tree', url: 'https://leetcode.com/problems/subtree-of-another-tree/', - pattern: 'DFS', + pattern: ['DFS'], difficulty: 'Easy', premium: false, companies: ['Amazon'], @@ -1636,7 +1627,7 @@ const questions = [ id: 138, name: 'Invert Binary Tree', url: 'https://leetcode.com/problems/invert-binary-tree/', - pattern: 'DFS', + pattern: ['DFS'], difficulty: 'Easy', premium: false, companies: ['Google', 'Microsoft', 'Amazon'], @@ -1645,7 +1636,7 @@ const questions = [ id: 139, name: 'Path Sum II', url: 'https://leetcode.com/problems/path-sum-ii/', - pattern: 'DFS', + pattern: ['DFS'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Microsoft', 'Quora'], @@ -1654,7 +1645,7 @@ const questions = [ id: 140, name: 'Path Sum III', url: 'https://leetcode.com/problems/path-sum-iii/', - pattern: 'DFS', + pattern: ['DFS'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Microsoft'], @@ -1664,7 +1655,7 @@ const questions = [ name: 'Lowest Common Ancestor of a Binary Tree', url: 'https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/', - pattern: 'DFS', + pattern: ['DFS'], difficulty: 'Medium', premium: false, companies: [ @@ -1681,7 +1672,7 @@ const questions = [ id: 142, name: 'Maximum Binary Tree', url: 'https://leetcode.com/problems/maximum-binary-tree/', - pattern: 'DFS', + pattern: ['DFS'], difficulty: 'Medium', premium: false, companies: ['Google'], @@ -1690,7 +1681,7 @@ const questions = [ id: 143, name: 'Maximum Width of Binary Tree', url: 'https://leetcode.com/problems/maximum-width-of-binary-tree/', - pattern: 'DFS', + pattern: ['DFS'], difficulty: 'Medium', premium: false, companies: ['Facebook', 'Amazon', 'Google', 'Microsoft'], @@ -1700,7 +1691,7 @@ const questions = [ name: 'Construct Binary Tree from Preorder and Inorder Traversal', url: 'https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/', - pattern: 'DFS', + pattern: ['DFS'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Microsoft', 'Google', 'Facebook', 'Bloomberg'], @@ -1709,7 +1700,7 @@ const questions = [ id: 145, name: 'Validate Binary Search Tree', url: 'https://leetcode.com/problems/validate-binary-search-tree/', - pattern: 'DFS', + pattern: ['DFS'], difficulty: 'Medium', premium: false, companies: [ @@ -1729,7 +1720,7 @@ const questions = [ id: 146, name: 'Kth Smallest Element in a BST', url: 'https://leetcode.com/problems/kth-smallest-element-in-a-bst/', - pattern: 'DFS', + pattern: ['DFS'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Oracle', 'Facebook', 'Apple', 'Bloomberg'], @@ -1738,7 +1729,7 @@ const questions = [ id: 147, name: 'Implement Trie (Prefix Tree)', url: 'https://leetcode.com/problems/implement-trie-prefix-tree/', - pattern: 'Trie', + pattern: ['Design', 'Trie'], difficulty: 'Medium', premium: false, companies: ['Amazon', 'Microsoft', 'Google', 'Facebook'], @@ -1747,7 +1738,7 @@ const questions = [ id: 148, name: 'Binary Tree Maximum Path Sum', url: 'https://leetcode.com/problems/binary-tree-maximum-path-sum/', - pattern: 'DFS', + pattern: ['DFS'], difficulty: 'Hard', premium: false, companies: ['Facebook', 'Microsoft', 'Amazon', 'Google', 'Uber', 'Apple'], @@ -1756,7 +1747,7 @@ const questions = [ id: 149, name: 'Serialize and Deserialize Binary Tree', url: 'https://leetcode.com/problems/serialize-and-deserialize-binary-tree/', - pattern: 'DFS', + pattern: ['Design', 'DFS'], difficulty: 'Hard', premium: false, companies: [ @@ -1775,7 +1766,7 @@ const questions = [ id: 150, name: 'Word Search II', url: 'https://leetcode.com/problems/word-search-ii/', - pattern: 'Trie', + pattern: ['DFS', 'Trie'], difficulty: 'Hard', premium: false, companies: [ @@ -1792,7 +1783,7 @@ const questions = [ id: 151, name: 'Find Median from Data Stream', url: 'https://leetcode.com/problems/find-median-from-data-stream/', - pattern: 'Two Heaps', + pattern: ['Heap'], difficulty: 'Hard', premium: false, companies: [ @@ -1809,7 +1800,7 @@ const questions = [ id: 152, name: 'Sliding Window Median', url: 'https://leetcode.com/problems/sliding-window-median/', - pattern: 'Two Heaps', + pattern: ['Heap'], difficulty: 'Hard', premium: false, companies: ['Amazon', 'Facebook', 'Google'], @@ -1818,7 +1809,7 @@ const questions = [ id: 153, name: 'Two Sum', url: 'https://leetcode.com/problems/two-sum/', - pattern: 'Two Pointers', + pattern: ['Two Pointers'], difficulty: 'Easy', premium: false, companies: [ @@ -1837,7 +1828,7 @@ const questions = [ id: 154, name: 'Remove Duplicates from Sorted List', url: 'https://leetcode.com/problems/remove-duplicates-from-sorted-list/', - pattern: 'Two Pointers', + pattern: ['Two Pointers'], difficulty: 'Easy', premium: false, companies: ['Amazon', 'Apple', 'Microsoft'], @@ -1846,7 +1837,7 @@ const questions = [ id: 155, name: 'Squares of a Sorted Array', url: 'https://leetcode.com/problems/squares-of-a-sorted-array/', - pattern: 'Two Pointers', + pattern: ['Two Pointers'], difficulty: 'Easy', premium: false, companies: [ @@ -1865,7 +1856,7 @@ const questions = [ id: 156, name: 'Backspace String Compare', url: 'https://leetcode.com/problems/backspace-string-compare', - pattern: 'Two Pointers', + pattern: ['Two Pointers'], difficulty: 'Easy', premium: false, companies: ['Google', 'Facebook', 'Amazon', 'Microsoft', 'Oracle'], @@ -1874,7 +1865,7 @@ const questions = [ id: 157, name: '3 Sum', url: 'https://leetcode.com/problems/3sum/', - pattern: 'Two Pointers', + pattern: ['Two Pointers'], difficulty: 'Medium', premium: false, companies: [ @@ -1893,7 +1884,7 @@ const questions = [ id: 158, name: '3 Sum Closest', url: 'https://leetcode.com/problems/3sum-closest/', - pattern: 'Two Pointers', + pattern: ['Two Pointers'], difficulty: 'Medium', premium: false, companies: ['Google', 'Facebook', 'Amazon', 'Apple', 'Microsoft'], @@ -1902,7 +1893,7 @@ const questions = [ id: 159, name: 'Subarrays with Product Less than K', url: 'https://leetcode.com/problems/subarray-product-less-than-k/', - pattern: 'Two Pointers', + pattern: ['Two Pointers'], difficulty: 'Medium', premium: false, companies: ['Akuna Capital', 'Google'], @@ -1911,7 +1902,7 @@ const questions = [ id: 160, name: 'Sort Colours', url: 'https://leetcode.com/problems/sort-colors/', - pattern: 'Two Pointers', + pattern: ['Two Pointers'], difficulty: 'Medium', premium: false, companies: [ @@ -1928,7 +1919,7 @@ const questions = [ id: 161, name: 'Minimum Window Substring', url: 'https://leetcode.com/problems/minimum-window-substring/', - pattern: 'Two Pointers', + pattern: ['Two Pointers'], difficulty: 'Hard', premium: false, companies: [ @@ -1948,7 +1939,7 @@ const questions = [ id: 162, name: 'Trapping Rain Water', url: 'https://leetcode.com/problems/trapping-rain-water/', - pattern: 'Two Pointers', + pattern: ['Two Pointers'], difficulty: 'Hard', premium: false, companies: [ @@ -1969,7 +1960,7 @@ const questions = [ id: 163, name: 'Container With Most Water', url: 'https://leetcode.com/problems/container-with-most-water/', - pattern: 'Two Pointers', + pattern: ['Two Pointers'], difficulty: 'Hard', premium: false, companies: [ @@ -1987,7 +1978,7 @@ const questions = [ id: 164, name: 'Longest Word in Dictionary', url: 'https://leetcode.com/problems/longest-word-in-dictionary/', - pattern: 'Trie', + pattern: ['Trie'], difficulty: 'Easy', premium: false, companies: ['Goldman Sachs', 'Google'], @@ -1996,7 +1987,7 @@ const questions = [ id: 165, name: 'Index Pairs of a String', url: 'https://leetcode.com/problems/index-pairs-of-a-string/', - pattern: 'Trie', + pattern: ['Trie'], difficulty: 'Easy', premium: true, companies: ['Amazon'], @@ -2005,7 +1996,7 @@ const questions = [ id: 166, name: 'Maximum XOR of Two Numbers in an Array', url: 'https://leetcode.com/problems/maximum-xor-of-two-numbers-in-an-array', - pattern: 'Trie', + pattern: ['Trie'], difficulty: 'Medium', premium: false, companies: ['Google'], @@ -2014,7 +2005,7 @@ const questions = [ id: 167, name: 'Concatenated Words', url: 'https://leetcode.com/problems/concatenated-words/', - pattern: 'Trie', + pattern: ['Trie'], difficulty: 'Hard', premium: false, companies: ['Amazon', 'Apple', 'Facebook'], @@ -2023,7 +2014,7 @@ const questions = [ id: 168, name: 'Prefix and Suffix Search', url: 'https://leetcode.com/problems/prefix-and-suffix-search/', - pattern: 'Trie', + pattern: ['Trie'], difficulty: 'Hard', premium: false, companies: ['Facebook', 'Google', 'Uber'], @@ -2032,7 +2023,7 @@ const questions = [ id: 169, name: 'Palindrome Pairs', url: 'https://leetcode.com/problems/palindrome-pairs/', - pattern: 'Trie', + pattern: ['Trie'], difficulty: 'Hard', premium: false, companies: ['Airbnb', 'Amazon', 'Facebook', 'Google', 'Square'], @@ -2041,7 +2032,7 @@ const questions = [ id: 170, name: 'Design Search Autocomplete System', url: 'https://leetcode.com/problems/design-search-autocomplete-system/', - pattern: 'Trie', + pattern: ['Trie'], difficulty: 'Hard', premium: true, companies: ['Amazon', 'Google', 'Lyft', 'Microsoft', 'Uber'], @@ -2050,7 +2041,7 @@ const questions = [ id: 171, name: 'Word Squares', url: 'https://leetcode.com/problems/word-squares/', - pattern: 'Trie', + pattern: ['Trie'], difficulty: 'Hard', premium: true, companies: ['Oracle'], From a29c373ea2ce237b43f49291bb6133c6cb5b44ba Mon Sep 17 00:00:00 2001 From: Sean Prashad Date: Sat, 6 Jun 2020 16:46:13 -0400 Subject: [PATCH 3/3] Update Pattern column cell render to support multiple patterns --- src/components/Table/index.js | 22 ++++++++++++++-------- src/components/Table/styles.scss | 3 ++- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/components/Table/index.js b/src/components/Table/index.js index ad070562..8f520d26 100644 --- a/src/components/Table/index.js +++ b/src/components/Table/index.js @@ -110,11 +110,20 @@ const Table = () => { { Header: 'Pattern', accessor: 'pattern', - Cell: cellInfo => ( -
- {`${cellInfo.row.original.pattern}`.replace(/,/g, ', ')} -
- ), + Cell: cellInfo => { + const patterns = `${cellInfo.row.original.pattern}` + .split(',') + .map(pattern => { + return ( + + {pattern} + + ); + }); + + return {patterns}; + }, + Filter: SelectColumnFilter, }, { @@ -177,9 +186,6 @@ const Table = () => { columns, data, defaultColumn, - initialState: { - sortBy: [{ id: 'pattern' }], - }, }, useFilters, useSortBy, diff --git a/src/components/Table/styles.scss b/src/components/Table/styles.scss index a25a9306..74197f9c 100644 --- a/src/components/Table/styles.scss +++ b/src/components/Table/styles.scss @@ -31,7 +31,8 @@ background-color: #d9534f; } - .companies { + .companies, + .patterns { justify-content: space-evenly; margin: 0; }