Solving Prefix and Suffix Search in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Examples:

Input:
WordFilter(["apple"])
WordFilter.f("a", "e") // returns 0
WordFilter.f("b", "") // returns -1

Note:

See the full details of the problem Prefix and Suffix Search at LeetCode

Originally posted at: @github.com/halfrost/LeetCode-Go