def spell_three_digits(num, power)
      answer = []
      yekan = nil
      num.each_with_index do |n, i|
        # The 'n' is zero? no need to evaluate
        next if n == '0'
        exception_index = n.to_i * (10**i)

        case i
        when 0
          # save Yekan to use for 10..19 exceptions
          yekan = n
        when 1
          # If we're in Sadgan and the digit is 1 so it's a number
          # between 10..19 and it's an exception
          if n == '1'
            exception_index = 10 + yekan.to_i
            answer.clear
          end
        end
        answer << EXCEPTIONS_INVERT[exception_index]
      end
      # append power of ten to first number based on `power` passed to function
      # ["7", "6", "5"], 3 #=> ['هفت هزار', 'شصت', 'پانصد']
      answer[0] = "#{answer[0]} #{(POWER_OF_TEN_INVERT[power])}".strip if answer.size > 0
      answer
    end
def spell_three_digits(num, power)
      answer = []
      yekan = nil
      num.each_with_index do |n, i|
        # The 'n' is zero? no need to evaluate
        next if n == '0'
        exception_index = n.to_i * (10**i)

        case i
        when 0
          # save Yekan to use for 10..19 exceptions
          yekan = n
        when 1
          # If we're in Sadgan and the digit is 1 so it's a number
          # between 10..19 and it's an exception
          if n == '1'
            exception_index = 10 + yekan.to_i
            answer.clear
          end
        end
        answer << EXCEPTIONS_INVERT[exception_index]
      end
      # append power of ten to first number based on `power` passed to function
      # ["7", "6", "5"], 3 #=> ['هفت هزار', 'شصت', 'پانصد']
      answer[0] = "#{answer[0]} #{(POWER_OF_TEN_INVERT[power])}".strip if answer.size > 0
      answer
    end
["7", "6", "5"], 3 #=> ['هفت هزار', 'شصت', 'پانصد']