Skip to main content
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

Javascript (ES6), 84 80 78 bytes

i=>new Set(s=[...i]).size>2?[i,s.reverse().join``].indexOf(s.sort().join``):-1 

Where wavy increasing is 0, decreasing is 1, and -1 is not wavy.

Thanks to @Neil@Neil for helping me save 2 bytes.

Javascript (ES6), 84 80 78 bytes

i=>new Set(s=[...i]).size>2?[i,s.reverse().join``].indexOf(s.sort().join``):-1 

Where wavy increasing is 0, decreasing is 1, and -1 is not wavy.

Thanks to @Neil for helping me save 2 bytes.

Javascript (ES6), 84 80 78 bytes

i=>new Set(s=[...i]).size>2?[i,s.reverse().join``].indexOf(s.sort().join``):-1 

Where wavy increasing is 0, decreasing is 1, and -1 is not wavy.

Thanks to @Neil for helping me save 2 bytes.

added 120 characters in body
Source Link

Javascript (ES6), 84 8080 78 bytes

i=>new Set(i,s=[...i]).size>2?[i,s.reverse().join``].indexOf(s.sort().join``):-1 

Where wavy increasing is 0, decreasing is 1, and -1 is not wavy.

Thanks to @Neil for helping me save 2 bytes.

Javascript (ES6), 84 80 bytes

i=>new Set(i,s=[...i]).size>2?[i,s.reverse().join``].indexOf(s.sort().join``):-1 

Where wavy increasing is 0, decreasing is 1, and -1 is not wavy.

Javascript (ES6), 84 80 78 bytes

i=>new Set(s=[...i]).size>2?[i,s.reverse().join``].indexOf(s.sort().join``):-1 

Where wavy increasing is 0, decreasing is 1, and -1 is not wavy.

Thanks to @Neil for helping me save 2 bytes.

added 1 character in body
Source Link

Javascript (ES6), 84 80 bytes

i=>new Set(i,s=[...i]).size>2?[i,s.reverse().join``].indexOf(s.sort().join``):-1 

Where wavy increasing is 0, decreasing is 1, and -1 is not wavy.

Javascript (ES6) 84 80 bytes

i=>new Set(i,s=[...i]).size>2?[i,s.reverse().join``].indexOf(s.sort().join``):-1 

Where wavy increasing is 0, decreasing is 1, and -1 is not wavy.

Javascript (ES6), 84 80 bytes

i=>new Set(i,s=[...i]).size>2?[i,s.reverse().join``].indexOf(s.sort().join``):-1 

Where wavy increasing is 0, decreasing is 1, and -1 is not wavy.

added 16 characters in body
Source Link
Loading
Source Link
Loading