Skip to content

Instantly share code, notes, and snippets.

View jchung05's full-sized avatar

Joey jchung05

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jchung05 on github.
  • I am jchung05 (https://keybase.io/jchung05) on keybase.
  • I have a public key ASA7A5EiCPK8pdkQ-6ZVVsywcDzrPwJV45548aLRJCBHSQo

To claim this, I am signing this object:

@jchung05
jchung05 / longest_strstr.py
Created October 21, 2018 17:25
Solution to Q3 from Leetcode
def function(s:str)->int:
longest = 1
tmplongest = 0
chardict = {}
i = 0
if not s:
return 0
while i < len(s):
@jchung05
jchung05 / string.sol
Last active October 21, 2018 17:14
Basic implementations of stdlib string functions in Solidity
pragma solidity ^0.4.24;
contract String {
using strings for *;
string public s;
function strlen(s1 string) public returns(uint) {
return byte(s1).length;
}
@jchung05
jchung05 / Maps.go
Last active September 25, 2018 00:47
An attempt at the A Tour of Go Maps exercise
package main
import (
"golang.org/x/tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
ret := make(map[string]int)
words := strings.Fields(s)
@jchung05
jchung05 / Slices.go
Created September 25, 2018 00:38
An attempt at the A Tour of Go Slices exercise
package main
import "golang.org/x/tour/pic"
func Pic(dx, dy int) [][]uint8 {
arr := make([][]uint8, dy)
for i := range arr {
arr[i] = make([]uint8, dx)
@jchung05
jchung05 / FibonacciClosure.go
Created September 25, 2018 00:31
An attempt at the A Tour of Go Fibonacci Closure exercise
package main
import "fmt
func fibonacci() func() int {
x := 0
y := 1
z := 0
return func() int {
z, x, y = x, y, x + y