Finding Strings Neighbors By Up To 2 Differing Positions
问题 Given a seed string, I want to find its neighbors with at most differ in 2 positions. All the digits involve in generating string are only four (i.e. 0,1,2,3). This is the example for what I mean: # In this example, 'first' column # are neighbors with only 1 position differ. # The rest of the columns are 2 positions differ Seed = 000 100 110 120 130 101 102 103 200 210 220 230 201 202 203 300 310 320 330 301 302 303 010 011 012 013 020 021 022 023 030 031 032 033 001 002 003 Seed = 001 101