Answer the question
In order to leave comments, you need to log in
How to organize an optimal object search algorithm?
Tell me how to optimally solve this problem:
There is an object with parameters
let item = {
self: {
p1: 0, p2: 1, p3: 3
},
find: {
p1: 0, p2: 0, p3: 1
}
}
item1 = { self: { p1: 0 }, find: { p1: 1 };
item2 = { self: { p1: 1 }, find: [ p1: 0 };
Answer the question
In order to leave comments, you need to log in
What's the problem with iterating over the entire array? Or make two other arrays self, find of the form ["013", "010"], where the states will be stored, and then search through them.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question