We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 41aa4de commit c6277e7Copy full SHA for c6277e7
scripts/algorithms/S/Search Suggestions System/Search Suggestions System.java
@@ -1,13 +1,14 @@
1
-class Solution
+// Runtime: 68 ms (Top 48.70%) | Memory: 45.5 MB (Top 96.95%)
2
+class Solution
3
{
- public List<List<String>> suggestedProducts(String[] products, String searchWord)
4
+ public List<List<String>> suggestedProducts(String[] products, String searchWord)
5
6
PriorityQueue<String> pq= new PriorityQueue<String>();
- List<List<String>> res= new LinkedList<List<String>>();
7
+ List<List<String>> res= new LinkedList<List<String>>();
8
List<String> segment= new LinkedList<String>();
9
for(int i=0;i<products.length;i++)
10
pq.offer(products[i]);
-
11
+
12
for(int j=0;j<searchWord.length();j++)
13
14
segment= new LinkedList<String>();
0 commit comments