we have warehouse LOCATIONS in a system like this.
D2705B, D2805C, F3805C, F3805F
So we used these all locations but want to know which locations are not used YET.
Case 1: D2705B USED means missing D2705A (Need to go back so ending with A is the missing location)
Case 1:D2805C USED means missing D2805B, D2805A (Need to go back so ending with A and B is the missing location)
Case 3: F3805C, F3805F First 4 digits same so C and F are used but B, A and D is missing
Basic Requirments are: For example, we have a stock location in system D2705A, D2705E, but if no product is using D2705B, C, D, then the system should show missing location D2705B, C, D;