Hello!
Sorry, I do not fully understand your pseudo code. Could you express desired input and output using elixir terms?