Member-only story
Trie
Read full article for free: https://liverungrow.medium.com/trie-5a96f386471a?sk=6a698d2121e03268ee341c2e4789530b
https://www.enjoyalgorithms.com/blog/introduction-to-trie-data-structure
The Trie data structure is a tree-like structure used for storing a dynamic set of strings.
It allows for efficient retrieval and storage of keys, making it highly effective in handling large datasets.
Trie supports operations such as insertion, search, deletion of keys, and prefix searches.
3043. Find the Length of the Longest Common Prefix
You are given two arrays with positive integers arr1
and arr2
.
A prefix of a positive integer is an integer formed by one or more of its digits, starting from its leftmost digit. For example, 123
is a prefix of the integer 12345
, while 234
is not.
A common prefix of two integers a
and b
is an integer c
, such that c
is a prefix of both a
and b
. For example, 5655359
and 56554
have common prefixes 565
and 5655
while 1223
and 43456
do not have a common prefix.