Can someone please provide a hint to the following problem?
Find all the possible 4 elements sets … you can check my answer here …
Also if you want to learn about this type of problem you can go and learn N queen problem which uses backtracking
Backtracking? What all concepts are required to solve this problem?
Also, what do you mean by finding all the possible 4 elements sets?
You can Google about the stuff …it would be a better way to understand … also you can search for the problem solution on the YouTube by typing THEATRE Feb long challenge on YouTube and you will get the video solution.which will help you to understand the solution in a better way …
Using backtrack it will be easy but you can solve without using it also. My friend solved without backtrack
I’ll give you one: try to associate permutations of the string “ABCD” to the parameters of the problem statement. When you hit a Eureka point, let me know
You can easily brute force all solutions since it’s a 4*4 matrix and out of which there are only few which are passing the criteria.
generate those combinations and then find the combination having highest score and output that
check the editorial bro
Its simple. Just try all combinations of the string “ABCD” and the array 25,50,75,100 and find the maximum answer.
So basically you’re asking me to try every possibility and find the maximum answer?