Remove an Entry using key from HashMap while Iterating over it
Given a HashMap and a key in Java, the task is to remove an entry from this HashMap using the key, while iterating over it. Examples: Input: HashMap: {1=Geeks, 2=ForGeeks, 3=GeeksForGeeks}, key = 2 Output: {1=Geeks, 3=GeeksForGeeks} Input: HashMap: {1=G, 2=e, 3=e, 4=k, 5=s}, key = 3 Output: {1=G, 2=