I have strings as elements in the arraylist and i would like to remove them in O(logn) time, using Java

i have tried using `HashSet` to copy and clear and copy back to another arraylist, but i think that's in O(n) time.