We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
If you already have solved the XOR Matrix problem, you already have the solution to this one. You can use the fact that the protein combination opertion together with the set of proteins forms an Abelian group where X=inv(X), to find a general formula for every 2 power second. This can then be used to find an algorithm that solves the problem in the worst case as O(Nlog(K)) and O(N) in best case.
I was tempted to show my solution but I think that is a bit unfair.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Mixing proteins
You are viewing a single comment's thread. Return to all comments →
If you already have solved the XOR Matrix problem, you already have the solution to this one. You can use the fact that the protein combination opertion together with the set of proteins forms an Abelian group where X=inv(X), to find a general formula for every 2 power second. This can then be used to find an algorithm that solves the problem in the worst case as O(Nlog(K)) and O(N) in best case. I was tempted to show my solution but I think that is a bit unfair.