-- http://www.codewars.com/kata/545f05676b42a0a195000d95
module RankVector where

import Data.List
import Data.Maybe

ranks :: Ord a => [a] -> [Int]
ranks xs = map (succ . fromJust . flip elemIndex ys) xs where
  ys = sortBy (flip compare) xs