Skip to content

Instantly share code, notes, and snippets.

vznvzn

Block or report user

Report or block vznvzn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bitwise51b.rb
def f2(n)
return n.odd? ? (n * 3 + 1) / 2 : n / 2
end
def d(s)
c = s.split('').select { |x| x == '1' }.size
d = c.to_f / s.length
return d
View traverse12.rb
def f2(n)
return n.odd? ? (n * 3 + 1) / 2 : n / 2
end
def d(s)
c = s.split('').select { |x| x == '1' }.size
d = c.to_f / s.length
return d
View construct52.rb
def f2(n)
return n.odd? ? (n * 3 + 1) / 2 : n / 2
end
def adj(ns)
ns1 = ns.dup
ns1[0, 1] = '10'
View construct51.rb
def f2(n)
return n.odd? ? (n * 3 + 1) / 2 : n / 2
end
def adj(ns)
ns1 = ns.dup
ns1[0, 1] = '10'
View traverse11.rb
def f2(n)
return n.odd? ? (n * 3 + 1) / 2 : n / 2
end
def d(s)
c = s.split('').select { |x| x == '1' }.size
d = c.to_f / s.length
return d
View traverse10.rb
def f2(n)
return n.odd? ? (n * 3 + 1) / 2 : n / 2
end
def d(s)
c = s.split('').select { |x| x == '1' }.size
d = c.to_f / s.length
return d
View traverse9c.rb
def f2(n)
return n.odd? ? (n * 3 + 1) / 2 : n / 2
end
def d(s)
c = s.split('').select { |x| x == '1' }.size
d = c.to_f / s.length
return d
View traverse9.rb
def f2(n)
return n.odd? ? (n * 3 + 1) / 2 : n / 2
end
def d(s)
c = s.split('').select { |x| x == '1' }.size
d = c.to_f / s.length
return d
View bitwise49.rb
def f2(n)
return n.odd? ? (n * 3 + 1) / 2 : n / 2
end
def d(s)
c = s.split('').select { |x| x == '1' }.size
d = c.to_f / s.length
return d
View construct49.rb
def f2(n)
return n.odd? ? (n * 3 + 1) / 2 : n / 2
end
def dense(w, d)
return '' if (w == 0)
w2 = w - 1
a = (0...w2).to_a
You can’t perform that action at this time.