#JavaScript (ES6) 66
JavaScript (ES6) 66
For once, the stupid negative % of javascript for negative numbers come useful
z=>(z+z).substr(-(l=z.length,[a,b]=z.match(/\d+/g),b?b+a:a)%l-l,l)
#JavaScript (ES6) 66
For once, the stupid negative % of javascript for negative numbers come useful
z=>(z+z).substr(-(l=z.length,[a,b]=z.match(/\d+/g),b?b+a:a)%l-l,l)
JavaScript (ES6) 66
For once, the stupid negative % of javascript for negative numbers come useful
z=>(z+z).substr(-(l=z.length,[a,b]=z.match(/\d+/g),b?b+a:a)%l-l,l)