lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Sun, Jul 4, 2021 at 11:17 AM Xmilia Hermit wrote:
Calculations should be completed in a reasonable amount of time.

Here is a solution with tunable number of slots used.

SOLVED.

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.

Problem #4
The same as problem #3 but a user may also assign nils to existing keys.

A solution should be both memory- and time- efficient.