crypto-007: week 3 solution working in constant memory