Walmart, the world’s largest retailer, has agreed to buy SoftBank’s one-fourth stake in Flipkart for between $4 billion and $4.5 …