Lingo is a game in which a word has to be guessed. The amount of letters of the word is given, and usually also the first letter is known. To guess the word, the player can say a word of the right amount of letters. The computer then indicates which letters are correct and in the right place and which letters occur in the word that needs to be guessed, but aren't in the right place. In the example underneath the two kinds of tips are respectively indicated with a red and a yellow color.

lingo

If you weren't already familiar with the game, you could play it online here1 as an example to train yourself. But be careful, it may be addictive.

Assignment

Write a function lingo with two parameters: guessed and searched. Strings should be given to both parameters that respectively contain a word that was given by the user and the hidden word the user must find. You may assume that both strings consist of lowercase letters and have the same length. The function must print a string as a result that contains a word that the user has given, but of which the letters that are correct and in the right place are between square brackets and the letters that do occur in the word to be guessed but are not in the correct place between round brackets. Here, we should observe the rules below: 

Example

>>> lingo('camelot', 'cembalo')
'[c](a)[m](elo)t'
>>> lingo('inquisition', 'reconquista')
'(inqu)i(s)i(t)i(o)n'
>>> lingo('python', 'embryo')
'p(y)th(o)n'
>>> lingo('megalomaniacally', 'circumstantiated')	 
'(me)g(a)loma(ni)a(c)[a]lly'