# [Japt](https://github.com/ETHproductions/japt), <s>61</s> <s>59</s> <s>92</s> <s>85</s> 84 bytes > I'm offline for most of the (long) weekend, if any more issues are discovered with this, please ask a mod to delete it for me until such a time as I can fix it. Takes input as a string for both operations and returns a string for both as well or `false` for invalid input.Assumes number inputs will always contain multiple digits, add 1 byte replacing `UÉ` with `Un<space>` if that's not valid. Returns `false` for test case `GIGATESTER` but, according to the rules, that *should be* invalid input. --- V="OIREASGTBP"UÉ?¡VgXÃe"%v"²_i1'NÃe"%V"²_i1'UÃ:!Uè"%v%v|%V%V|[^{V}NU]" ©Ur"N|U" £VaX **Try it:** [Numbers -> Letters](http://ethproductions.github.io/japt/?v=1.4.5&code=Vj0iT0lSRUFTR1RCUCJVyT+hVmdYw2UiJXYisl9pMSdOw2UiJVYisl9pMSdVwzohVegiJXYldnwlViVWfFtee1Z9TlVdIiCpVXIiTnxVIiCjVmFY&input=IjMxNDE1OTIiCg==) or [Letters -> Numbers](http://ethproductions.github.io/japt/?v=1.4.5&code=Vj0iT0lSRUFTR1RCUCJVyT+hVmdYw2UiJXYisl9pMSdOw2UiJVYisl9pMSdVwzohVegiJXYldnwlViVWfFtee1Z9TlVdIiCpVXIiTnxVIiCjVmFY&input=IkVOSU5BTklTVVBVUiIK) --- - <s>2</s> 4 bytes saved thank to [obarakon](https://codegolf.stackexchange.com/users/61613/obarakon), who also convinced me to take this up again after I abandoned it earlier. I wish he hadn't! - <s>33</s> <s>26</s> 25(!) bytes sacrificed implementing a quick fix (i.e., yet to be fully golfed) to check input validity. --- ## Explanation (Yet to be updated to the latest version) :Implicit input of string U. V="..." :Assign the string of letters to variable V, in order. UÉ :Subtract 1 from U, which will give a number (truthy) if the input is a number or NaN (falsey) if the input is a string. ? :If it's a number then ¡ : Map over the input string, replacing each character (digit) with ... VgX : the character in string V at index X, the current digit. Ã : End mapping. e : Recursively replace ... "%v"² : every occurrence of 2 vowels (RegEx) ... _i1'N : with the current match with an "N" inserted at index 1. Ã : End replacement. e : Another recursive replacement of ... "%V"² : every occurrence of 2 non-vowel characters (i.e., consonants) ... _i1'U : with the current match with a "U" inserted at index 1. Ã : End replacement. : :Else, if it's a string then Uè"%v%v|%V%V|[^{V}NU]" : Count the number of matches of 2 successive vowels OR 2 successive non-vowels OR any character not in contained in string V plus N & U. : (The longest part of this code is the fecking input validation!) ? : If that count is greater than 0 then T : Return 0. : Else Ur"N|U" : Replace every occurrence of "N" OR "U" in string U with nothing. £ : Map over the string, replacing each character (letter) with ... VaX : the index of the current character X in string V. :Implicit output of resulting string