added word position ruby solution