Skip to content

Commit 5edf330

Browse files
author
Joseph Luce
authored
Update Longest_movie_title.md
1 parent 90ebf07 commit 5edf330

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

real_interview_questions/Google/Longest_movie_title.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ You could further join 'OF MICE AND MEN IN BLACK' wth 'BLACK MASS' to form 'OF M
1212
```
1313

1414
# EXPLAINATION
15-
This is another graph problem. Make an adjacent list for each title. You may need need a hash table to help you perform this, mainly a hash table with first word as the key and the title as the value.
15+
This is another graph problem. Make an adjacent list for each title. You may need a hash table to help you perform this, mainly a hash table with first word as the key and the title as the value.
1616

1717
Then create a method that goes through all the titles and performs a DFS. When using a DFS on a graph, you will need a stack/recursion to keep the current longest title found so far. For each neighbor, we will call a DFS and concat the result from that search to our title and check if that new result is better than our result found so far.
1818

0 commit comments

Comments
 (0)