A variant of LeetCode problem 49: given a list of integers, count the number of identical elements.
Implement count_identical_elements(nums). The input is a non-empty list of integers. Return a list of [value, count] pairs, sorted by value in ascending order. Each pair reports how many times that integer appears.
def count_identical_elements(nums):