Here is my solution:
UPDATE: I’ve also implemented a solution in Erlang with a different internal representation that simplifies the explode operation.
Here is my solution:
UPDATE: I’ve also implemented a solution in Erlang with a different internal representation that simplifies the explode operation.