Search Auto-Complete for Special Languages

Solve a medium-level problem of querying a search engine for languages that are written in reverse order.

Problem statement

Some languages, like Persian, are written from right to left instead of left to right. We have to design an auto-complete feature for such languages. We're provided with a list of keywords and a query string. Design a system that provides query suggestions from the keyword list to the user every time the user types a character of the query string.

Example

Sample input

Get hands-on with 1200+ tech skills courses.