1. A method comprising: in a memory device configured to write data to storage elements by performing at least one of a first operation on one or more first storage elements that are in a first state and a second operation on one or more second storage elements that are in a second state, wherein the first operation changes the first state to the second state, wherein the second operation changes the second state to the first state, and wherein the memory device includes a resistive random access memory (ReRAM), performing: receiving the data to be stored to the storage elements; applying a mapping to the received data to generate mapped data, wherein the mapping comprises a one-to-many mapping; and writing the mapped data to the storage elements, wherein the mapping is configured to reduce average write time by mapping at least one incoming data value into a mapped value such that the second operation is not required for storing the mapped value to the storage elements, and wherein the mapping of the received data to the mapped data does not depend on the states of the storage elements prior to the writing of the mapped data.