add ruby solution to q024
add brutal force solution in python