Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- MARKER_SIZE = 4; # 14 for part 2;
- while (n+=1) {
- if (isCharsUnique(substr($0, n, MARKER_SIZE))) {
- print n + MARKER_SIZE - 1; break;
- }
- }
- }
- func isCharsUnique(string, i, ar) {
- for (i=1;i<=length(string);i++) {
- ar[substr(string, i, 1)] = 1;
- }
- return length(ar) == length(string);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement