Bash Script Check If Variable Contains Duplicate Leetcode