Rakuten Interview Question

Online coding task with negabinary arithmetics.