Add and Search Word - Data structure design, is a LeetCode problem. In this post we will see how we can solve this challenge in Swift

Problem Description

You can find the full details of the problem Add and Search Word - Data structure design at LeetCode

Solution

Time Complexity: addWord - O(n), n stands for the length of the word; search - O(24^n)

Space Complexity: addWord - O(n), search - O(1)

Please check the main.swift snippet for the solution.

This solution originally posted at: Github by @soapyigu