On Sun, Jul 4, 2021, 14:21 Egor Skriptunoff wrote:
Problem #3
Hide a string of arbitrary length into an existing table without modifying its original content.
In other words, write functions hide(tab, str) and str=unhide(tab).
A user may assign non-nil values to existing keys of the table between hide() and unhide() invocations.
I may be misunderstanding the problem, but based on how I understand the constraints:
local secret_key={}
function hide(tab, str) tab[secret_key]=str end
function unhide(tab) return tab[secret_key] end
This does not "modify its original content".