def groups size
      #1234567   => %w(765 432 1)
      @array = in_groups_of(@number.to_s.reverse.split(""), size)
      #%w(765 432 1) => %w(1 432 765)
      @array.reverse!

      #%w(1 432 765) => [1, 234, 567]
      @array.map! {|group| group.reverse.join("").to_i}
      @array.reverse! # put in ascending order of power of ten

      power = 0

      #[1, 234, 567] => {6 => 1, 3 => 234, 0 => 567}
      @array.inject({}) do |o, digits|
        o[power] = digits
        power += size
        o
      end
    end
def groups size
      #1234567   => %w(765 432 1)
      @array = in_groups_of(@number.to_s.reverse.split(""), size)
      #%w(765 432 1) => %w(1 432 765)
      @array.reverse!

      #%w(1 432 765) => [1, 234, 567]
      @array.map! {|group| group.reverse.join("").to_i}
      @array.reverse! # put in ascending order of power of ten

      power = 0

      #[1, 234, 567] => {6 => 1, 3 => 234, 0 => 567}
      @array.inject({}) do |o, digits|
        o[power] = digits
        power += size
        o
      end
    end
split into groups this gives us 1234567 => 123 456 7
so we need to reverse first
in stages