Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I am trying to find a solution to a problem in the best possible way. My code has 2 restrictions:
1) It supports only 50 search parameters.
2) It support (A OR B) AND C but not (A AND B) OR C.
I have a search criteria as:
Name: N1, N2, N3.......N25
Department: D1, D2, D3..........D50
City: C1, C2.....C10
I want to build an algorithm that takes the optimum query to search. I can see only one way is
(N1 OR N2 OR N3 OR .. OR N16) AND (D1 OR D2 OR D3 OR .. OR D16) AND (C1 OR C2 OR C3 OR .. OR C10)
This way I want all combinations to fetch my results. Any ideas would really help. Thanks