That's the attitude that didn't get the Good Friday Agreement and so far a sustained (more than less) peace in Ireland.
This won't remove Hamas. The only way to eliminate the poisonous politics of Hamas extremism is to create a sustainable less extreme situation that the majority of Palestinians (and Israelis) can live with.
That is probably a two state solution (given Israel wouldn't accept a one state solution that would eventually have an arab demographic majority). But it needs to be a 2 state solution where Palestine has control over it's external borders, where it has the ability to develop and prosper environmentally and economically and not be kept (deliberately) on the edge of starvation and poverty, driving people who generally don't care for the violence into the arms of terrorists and extremists as they are the only ones to offer (the fantasy of) change.
It means that Israel will have to accept UN resolutions and land borders that it doesn't want to accept to allow for the creation of a contiguous Palestinian state from the 'river to the sea' connecting the full de-settlered West Bank and Gaza -pre-1967 boundaries. It would include relinquishing east Jerusalem. It may even require Israel to pay reparations for stolen land in 1948 to balance the non-return to those lands of exiled forced 'migrants'. It should include the return of the Golan heights to Syria as well.
It would be a hard hit for Israel, especially the froth-at-the-mouth Settler movement and the current extreme right Government, but bombs and tanks have never won a peace.
There have been opportunities to achieve this before, but despite the US led narrative that it was the Arabs who derailed peace talks, the Israelis were to blame in most cases. Moderate Israelis need to accept that even if they flatten Gaza and settle the West Bank this won't eliminate indigenous extremism and that a political settlement that side lines Hamas is the only sustainable out from this mess.