preface

I wonder if you have the same opinion? The world a copy of products, is more powerful than the PROGRAMMER’s CV method!

For example, the product manager often says: “Please refer to xx, XX, XX”. In fact, we do not have their background account, so he clicked it twice for us to see.

The effect

Anyway, every e-commerce company must have its own commodity center. Today, I am too lazy to work overtime. I will take you to realize the SKU of the commodity center.

To see this effect, first of all, we need to find the algorithm direction, one is the full combination, the other is the comparison, starting roughly from the following two points:

Algorithm 1: To achieve full combination of most groups, the requirements are as follows:

Algorithm 2: Compare two arrays according to tableEnName, the requirements are as follows:

When the big guy sees such a clear requirement, he probably thinks, “Easy!” . In fact, a lot of things others to help you clear up of course feel simple, actual operation or will be tricky. However, I want to tell a story here, is the picture below!

The implementation of algorithm 1 is as follows:

The implementation of algorithm 2 is as follows:

The source code

The directory structure is roughly as follows:

GitHub repository address

Github.com/TJH0420/Dyn…

If you are interested, welcome Download!

If you have more excellent writing method, welcome to leave a message oh!