This is new and best consensus algorithm.
Solution is basic, the new consensus algorithm Safe Proof of Work, blocks will have a two hash block, and miner select from random, first hash mining or second hash mining. this is changed all mining proccess. And add into the hash, the merkle root of the blocks of the blockchain the miners wants to add. If first hash blocks merkler root not equal second hash blocks merkle root, all nodes and miners restart process.
If you want to know more, you can check the my github repository. (github/onuratakan/SPOW ) I published with mozilla public license.