You are viewing a single comment's thread. Return to all comments →
This is slightly edited Jullia language code made by Bart, it works but is way too slow.
function shortPalindrome(s::AbstractString)::Int n = length(s) count(i -> s[i[1]] == s[i[4]] && s[i[2]] == s[i[3]] && i[1] < i[2] < i[3] < i[4], CartesianIndices((1:n, 1:n, 1:n, 1:n))) end
Seems like cookies are disabled on this browser, please enable them to open this website
Short Palindrome
You are viewing a single comment's thread. Return to all comments →
This is slightly edited Jullia language code made by Bart, it works but is way too slow.