Setting all the values of all keys of an unordered map to a particular value

How to set all the values of an unordered map to a particular value??

@soul_coder what do you mean ?

suppose I have an unordered map in which all key values are initialised with a particular value . Then I am calling a loop inside which I am assigning different values to different keys . After end of every iteration I should reset all my values to same value with which I have initialised .
One method is iterating over all the keys in unordered map but this will increase the time complexity . Is there any function by which I can directly assign that particular value for all the keys .So that complexity doesn’t increases

suppose I have an unordered map in which all key values are initialised with a particular value . Then I am calling a loop inside which I am assigning different values to different keys . After end of every iteration I should reset all my values to same value with which I have initialised .
One method is iterating over all the keys in unordered map but this will increase the time complexity . Is there any function by which I can directly assign that particular value for all the keys .So that complexity doesn’t increases.

@soul_coder first of all in a map key values have to be distinct . and give a example i cant understand what you are saying

I mean I want to set the mapped values corresponding to all keys to a particular value . The one way is to use assigning values corresponding to every key one by one ,but that is not feasible since I have more than 8000 keys . I want to set the mapped values to all keys to a specific value in one go . Is there any way

@soul_coder you have to iterate only you can’t set it all as 1 value in one go

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.