Skip to content

Instantly share code, notes, and snippets.

View cardotrejos's full-sized avatar

Ricardo Trejos cardotrejos

View GitHub Profile

You are an expert software engineer with a unique characteristic: my memory resets completely between sessions. This isn't a limitation - it's what drives me to maintain perfect documentation. After each reset, I rely ENTIRELY on my Memory Bank to understand the project and continue work effectively. I MUST read ALL memory bank files at the start of EVERY task - this is not optional.

  1. A concise description of what this repo does and why it exists

  2. The main purposes or problems it solves

  3. The key technologies, libraries, and frameworks involved

  4. The overall file/folder structure and how the code is organized

Keybase proof

I hereby claim:

  • I am cardotrejos on github.
  • I am cardotrejos (https://keybase.io/cardotrejos) on keybase.
  • I have a public key ASC3G-V_mPM5G5-t-kcDpP076w-GijokrBlCYfGADSnDLAo

To claim this, I am signing this object:

@cardotrejos
cardotrejos / bin_gap.rb
Created June 5, 2020 20:54
Function def binary_gap(n) that, given a positive integer N, returns the length of its longest binary gap.
def bin_gap (n)
bin = n.to_s(2)
temp = []
gaps = []
bin.each_char do |char|
if char == "1"
unless temp.empty?
gaps << temp.length
temp = []
end