':type nums: List[int]
:rtype: List[int]'

def countSmaller(self, nums):

    res = ([0] * len(nums))
    bst = self.BST()
    for i in reversed(xrange(len(nums))):
        bst.insertNode(nums[i])
        res[i] = bst.query(nums[i])
    return res
