The solution: Change the conditions of the Palestinian people. Grant them the same rights as Israeli citizens. Allow freedom of movement in the country and abroad. Allow them employment and the ability to buy property. When they have the same rights as Israeli citizens, the impetus for Hamas will fall away. They will be vilified by Palestinians and Israelis.
How we get there is the conundrum. I agree that this needs UN intervention. But without United States support, intervention is moot. The first step is a ceasefire, which should be internationally supported immediately.