Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- perm("abc", "012") == "abc"
- perm("abc", "210") == "cba"
- perm("abc", "201") == "cab"
- array<int, 10> perm{ 2,7,4,9,8,3,5,0,6,1 };
- array<int, 10> perm_inverse;
- for (int i = 0; i < 10; ++i) perm_inverse[perm[i]] = i;
- for (int i = 0; i < 10; ++i) cout << perm_inverse[i] << ",";
- While ( seq_c!= end )
- {
- if( perm(perm(str, seq), seq_c) == str)
- return seq_c;
- ++seq_c;
- }
Add Comment
Please, Sign In to add comment