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;
2
Answers
As far as I understand your question, you need to generate all missing "locations" based on the last letter from the number. So if you have:
F3805F
, you need to getF3805A
,F3805B
,F3805C
,F3805D
,F3805E
.That gives you an array of missing locations:
You can now diff this array with existing locations.