Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Learn ruby with doukaku

Learn ruby with doukaku

西日暮里.rb ゴールデンだよLT大会 @ 秋葉原UDX!!

Fumiaki MATSUSHIMA

April 28, 2016
Tweet

More Decks by Fumiaki MATSUSHIMA

Other Decks in Programming

Transcript

  1. ...

  2. /*0*/ test( "1a2t3s2s", "11" ); /*1*/ test( "1a1c1d00", "22" );

    /*2*/ test( "00", "20" ); /*3*/ test( "3q", "6" ); /*4*/ test( "3t2a", "8" ); /*5*/ test( "3t3a", "8" ); /*6*/ test( "3t4a", "12" ); /*7*/ test( "004q2g", "32" ); /*8*/ test( "4c2g2k4i", "24" ); /*9*/ test( "1o1a4f4i1t", "26" ); /*10*/ test( "4t3a4g2a2o2p", "24" ); /*11*/ test( "4i4o3i3c3n3h2c", "30" ); /*12*/ test( "4m3n3m002b1b3a", "34" ); /*13*/ test( "001b2a3t4s3s2s1s", "27" ); /*14*/ test( "1n1j3o4o1h2n2r1k", "36" ); /*15*/ test( "4o2a2j1m2e4l2l3m3o", "42" );
  3. Array#combination a = [1, 2, 3, 4] a.combination(1).to_a => [[1],[2],[3],[4]]

    a.combination(2).to_a => [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]] a.combination(3).to_a => [[1,2,3],[1,2,4],[1,3,4],[2,3,4]] a.combination(4).to_a => [[1,2,3,4]]
  4. &.