Skip to content

Instantly share code, notes, and snippets.

function! Gf()
let l:f = expand("<cfile>") . ".md"
if !filereadable(l:f)
echo system("zit checkout -include-akte " . expand("<cfile>"))
endif
execute 'tabedit' l:f
" try
package main
import (
"io"
"os"
"strings"
)
type ControlCharacter int

Problem:

  • Given a string, reverse it word by word.
  • After you’ve that, write your own split function and use that instead of the builtin one

Example:

  • Input: "hard so be to have not does interview coding"
    Output: "coding interview does not have to be so hard"

Problem:

  • Implement a queue with 2 stacks.

Restrictions:

  • Remember that you cannot access access members of a stack, you can only pop off of it

Problem:

  • Given an array, convert the array into a linked list

Example:

  • Input: [1, 2, 3, 4, 5, 6]
    Result: 1->2->3->4->5->6->null

  • Input: [1, 3, 5, 2, 4]

Problem:

  • Given an array of integers, return indices of the two numbers such that they add up to a specific target.

  • You may assume that each input would have exactly one solution, and you may not use the same element twice.

Example:

  • Input: nums = [2, 5, 4], target = 6

Keybase proof

I hereby claim:

  • I am friedenberg on github.
  • I am friedenberg (https://keybase.io/friedenberg) on keybase.
  • I have a public key whose fingerprint is 19B2 F931 85BD 7C8C AB05 DFD8 1538 B6E2 521C 7FD5

To claim this, I am signing this object:

@friedenberg
friedenberg / RegexSwitch.io
Last active December 30, 2015 02:51
RegexSwitch.io
Regex
Object do(
regSwitch := method(
body := call argAt(0)
default := nil
while(body != nil,
if(RegexSwitchCase hasSlot(body name),
#this pulls the first message out of the chain and isolates it
current_body := body clone do(setNext(nil))