In this article, we will see how we can find the longest common suffix (i.e ending) that all the strings given to us have. We shall start with the brute-force approach for two strings. Following this, we will implement the Trie data structure to solve the problem for more than two strings.
Table of content:
Understanding the problem: Longest Common SuffixBrute force approach for two given stringsScaling of the brute force approachUsing Trie data structure for an optimized approach
Let us un...
Published on September 03, 2021 01:37