You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: max_69_number.rb
    path of file: ./repos/Ruby/data_structures/arrays
    
    the code of the file until where you have to start completion: # Challenge name: Maximum 69 number
#
# Given a
    
def max_number(num)
  arr = num.to_s.split('')

  arr.each_with_index do |num, i|
    if num == '6'
      arr[i] = '9'
      return arr.join.to_i
    end
  end