B
B
blanka2017-03-27 14:46:39
Algorithms
blanka, 2017-03-27 14:46:39

What is the condition check algorithm?

It is impossible to think over the verification algorithm.
Essence. Let's say there are 3 types of goods (SKU-1, SKU-2, SKU-3).
There are combinations of goods that can be written off:
1. Any 2 types of goods (SKU) (3pcs). That is, combinations of SKU-1 and SKU-2, SKU-1 and SKU-3, SKU-2 and SKU-3.
2. Product SKU-2 (2pcs).
Total available:

  • SKU-1 - 5pcs
  • SKU-2 - 5pcs
  • SKU-3 - 0

There is evidence that:
- according to condition No. 1, it was written off 2 times.
- according to condition No. 2, it was written off 2 times.
Task: to check whether such a write -off was possible .
So, if there were 10 goods in total (5 + 5 + 0), then write-off according to condition No. 1 (3pcs) 2 times = 3 * 2 = 6, and according to condition No. 2 (2pcs) 2 times = 2 * 2 = 4. Then 6 + 4 = 5 + 5 + 0 is true, which is not correct, since if the conditions are met, there is a remainder of SKU-1 - 3pcs.
Conditions (image):
e89488ff65e44f368f59a9fa0ee80981.png

Tell me in which direction to dig, otherwise I can’t figure it out somehow.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Therapyx, 2017-03-27
@blanka

Duck, according to the first condition, any 2 types of goods can be written off in a quantity of 3 pcs.
If the first write-off is completely from SKU1 and the second is in the amount of two units from SKU1 and one from SKU2, then exactly 4 remains in SKU2 for two write-offs from the 2nd condition.
Or I apparently misunderstood the first condition, but "Any 2 types of goods 3pcs." All the same, it should also imply the possibility of combining these goods, because it is not indicated there that the write-off can be any, but all 3 pieces must be written off from the 1st SKU

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question