Skip to main content
added 3 characters in body
Source Link

Java 8 197 187 193 193192 bytes


Thanks to all the commenters who worked with me on this monstrosity. It was golfed down to 187 bytes until I found a costly bug. However due to the power of Black Magic the "runs down to" operator "-->" the byte count is at a healthy 193192 bytes.
String a(int[]b){int l=b.length,d=1,i=0;String c="{";for(;i<l-1;i++)if(b[i]>b[i+1])c+=b[i]+"},{";else if(b[i]<b[i+1]){d+=1;c+=b[i]+"d++;c+=b[i]+",{";}else c+=b[i]+",";c+=b[l-1];while(d-->0)c+="}";return c;}

Java 8 197 187 193 bytes


Thanks to all the commenters who worked with me on this monstrosity. It was golfed down to 187 bytes until I found a costly bug. However due to the power of Black Magic the "runs down to" operator "-->" the byte count is at a healthy 193 bytes.
String a(int[]b){int l=b.length,d=1,i=0;String c="{";for(;i<l-1;i++)if(b[i]>b[i+1])c+=b[i]+"},{";else if(b[i]<b[i+1]){d+=1;c+=b[i]+",{";}else c+=b[i]+",";c+=b[l-1];while(d-->0)c+="}";return c;}

Java 8 197 187 193 192 bytes


Thanks to all the commenters who worked with me on this monstrosity. It was golfed down to 187 bytes until I found a costly bug. However due to the power of Black Magic the "runs down to" operator "-->" the byte count is at a healthy 192 bytes.
String a(int[]b){int l=b.length,d=1,i=0;String c="{";for(;i<l-1;i++)if(b[i]>b[i+1])c+=b[i]+"},{";else if(b[i]<b[i+1]){d++;c+=b[i]+",{";}else c+=b[i]+",";c+=b[l-1];while(d-->0)c+="}";return c;}
added 166 characters in body
Source Link

Java 8 197 187 187193 bytes


Shaved off 10 whole bytes thanksThanks to all the commentors below Java? Verbose? Take a look atcommenters who worked with me on this monstrosity  . It was golfed down to 187 bytes until I found a costly bug. However due to the power of Black Magic the "runs down to" operator "-->" the byte count is at a healthy 193 bytes.
String a(int[]b){int l=b.length,d=1;Stringd=1,i=0;String c="{";for(int i=0;i<l;i<l-   1;i++)if(b[i]>b[i+1])c+=b[i]+"},{";else if(b[i]<b[i+1]){d+=1;c+=b[i]+",{";}c+=b[lelse c+=b[i]+",";c+=b[l-1];for1];while(int i=0;i<d;i++d-->0)c+="}";return c;}

Java 8 197 187 bytes


Shaved off 10 whole bytes thanks to the commentors below Java? Verbose? Take a look at this monstrosity  
String a(int[]b){int l=b.length,d=1;String c="{";for(int i=0;i<l-   1;i++)if(b[i]>b[i+1])c+=b[i]+"},{";else if(b[i]<b[i+1]){d+=1;c+=b[i]+",{";}c+=b[l-1];for(int i=0;i<d;i++)c+="}";return c;}

Java 8 197 187 193 bytes


Thanks to all the commenters who worked with me on this monstrosity. It was golfed down to 187 bytes until I found a costly bug. However due to the power of Black Magic the "runs down to" operator "-->" the byte count is at a healthy 193 bytes.
String a(int[]b){int l=b.length,d=1,i=0;String c="{";for(;i<l-1;i++)if(b[i]>b[i+1])c+=b[i]+"},{";else if(b[i]<b[i+1]){d+=1;c+=b[i]+",{";}else c+=b[i]+",";c+=b[l-1];while(d-->0)c+="}";return c;}
added 3 characters in body
Source Link

Java 8 197 187 bytes


Shaved off 10 whole bytes thanks to the commentors below Java? Verbose? Take a look at this monstrosity
String a(int[]b){int l=b.length,d=1;String c="{";for(int i=0;i<l-   1;i++)if(b[i]>b[i+1])c+=b[i]+"},{";else if(b[i]<b[i+1]){d+=1;c+=b[i]+",{";}c+=b[l-1];for(int i=0;i<d;i++)c+="}";return c;}

Java 8 197 187 bytes


Shaved off 10 whole bytes thanks to the commentors below Java? Verbose? Take a look at this monstrosity
String a(int[]b){int l=b.length,d=1;String c="{";for(int i=0;i<l-1;i++)if(b[i]>b[i+1])c+=b[i]+"},{";else if(b[i]<b[i+1]){d+=1;c+=b[i]+",{";}c+=b[l-1];for(int i=0;i<d;i++)c+="}";return c;}

Java 8 197 187 bytes


Shaved off 10 whole bytes thanks to the commentors below Java? Verbose? Take a look at this monstrosity
String a(int[]b){int l=b.length,d=1;String c="{";for(int i=0;i<l-   1;i++)if(b[i]>b[i+1])c+=b[i]+"},{";else if(b[i]<b[i+1]){d+=1;c+=b[i]+",{";}c+=b[l-1];for(int i=0;i<d;i++)c+="}";return c;}
added 15 characters in body
Source Link
Loading
deleted 89 characters in body
Source Link
Maltysen
  • 25.8k
  • 4
  • 55
  • 127
Loading
added 50 characters in body
Source Link
Loading
added 39 characters in body
Source Link
Loading
Source Link
Loading