JSL Programming Challenge: Convert from string of Ys and Ns to matrix of 1s and 0s, and back again
Hi JSL programmers, I had a little problem as part of a larger application and thought I'd share it with you, and see if there's a way to do it better/slicker. Basically I have a vector of 1s and 0s (i.e. [1, 1, 0, 0, 1]) that I need to convert to a string of Ys and Ns (i.e. "YYNNY"). Then I need to do the reverse, that is convert a string of Ys and Ns back to a vector of 1s and 0s. Here are my...