# Search Results

Results tagged with Search options answers only user 3808
7 results

For challenges regarding counting the number of occurrences of some characteristic.

JavaScript (updated to work with all test cases) The little-known truth is that there are actually four 6s, but one of the betrayed the others and polymorphed into code form to eradicate them from …
answered Apr 29 '14 by Doorknob
Ruby This is (I think) the first answer that works for 666666666. (Except the cheaty subtracting -1 answer. ;) ) x = gets.chomp.to_i + 1 p (x..x.to_s.gsub('666', '667').to_i).select{|i| !(i.to_s.ind …
answered Apr 29 '14 by Doorknob
Ruby, 57 (67 without Rational) (-3 if run in IRB) p((a=[*1..100]).product(a).map{|x|Rational *x}.uniq.size) Output: 6087 Can be 3 less characters if run in IRB, because you can remove the p( and …
answered Apr 9 '14 by Doorknob
Pyth, 46 45 44 bytes eSKtMQjsM_mm?sJ,kd?q#J.umtWbbNeSKK\#\.\XhQeQ Try it here. Explanation: move-count-printing: K assign K to... Q the input, a 2-length array... tM with each e …
answered Apr 3 '16 by Doorknob
Ruby, 53 bytes i=0;p gets.chars.map{|c|i+=('] ['.index(c)||1)-1}.max Input from STDIN, output to STDOUT. i=0; initialize counter variable p output to STDOUT... g …
answered Feb 8 '16 by Doorknob
Snowman 1.0.2, 16 characters ~vgvgaSaLNdEtSsP Surprisingly short. Explanation: ~ make all vars active (even though we only need two, we don't really care) vgvg get two lines of input aS …
answered Sep 3 '15 by Doorknob
Brainfuck, 71 61 59 bytes +[>,]<[>-[<->---]+<------[->[-]<]>[-<+>]<[-<[<]<+>>[>]]<]<. Takes input from STDIN in the format given in the question, and outputs the character whose ASCII code is the l …
answered Nov 10 '16 by Doorknob