1. A method of storing data into a memory array having multiple memory devices, comprising: converting an input string into a first binary array with (m−1) rows and (n−1) columns; generating from the first binary array a second binary array with m rows and n columns and in an encoded bit pattern, wherein the second binary array in the encoded bit pattern has at most n/2 1's in each row and at most m/2 1's in each column, and wherein an m-th row and an n-th column of the second binary array in the encoded bit pattern contain information for decoding other entries of the second binary array; and storing the encoded bit pattern of the second binary array into corresponding memory devices of the memory array.