Skip to content

Instantly share code, notes, and snippets.

View foolem's full-sized avatar
☺️
creating things with text

Filipe Fenrich foolem

☺️
creating things with text
View GitHub Profile
const icons = [
{
name: "AiFillAccountBook",
set: "ai",
translations: "conta,livro,",
},
{
name: "AiFillAlert",
set: "ai",
translations: "alerta,",
@foolem
foolem / gist:e6c1e783fd7161c220625ce64cb7e33b
Last active April 9, 2020 03:18
Codility- binary gap in ruby
def solution(n)
binary = n.to_s(2)
lengths = []
i = binary.index("1")
binary.split("1").length.times do
binary[i] = '.'
n_i = binary.index("1")
return !lengths.empty? ? lengths.max : 0 if !!!n_i