I also do this, but the right way to parse the output of ls would really be to remember the syntax of stat(1). That way you avoid any trouble with spaces and other such problems, and the command is not much longer:
$ find -print0 | xargs -0 stat -c "%U %G" | sort -u > user_group_list