title | header | categories | tags | ||||
---|---|---|---|---|---|---|---|
Welcome to Jekyll! |
|
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"code.google.com/p/go-tour/pic" | |
"image" | |
"image/color" | |
) | |
type Image struct{ | |
Height, Width int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* for testing */ | |
package kth | |
import ( | |
"sort" | |
) | |
func Solution(array []int, commands [][]int) []int { | |
answer := []int{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* for testing */ | |
package kth | |
import ( | |
"sort" | |
) | |
func Solution(array []int, commands [][]int) []int { | |
answer := []int{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package kth | |
import ( | |
"reflect" | |
"testing" | |
) | |
func TestSolution(t *testing.T) { | |
cases := []struct { | |
in1, want []int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package moketest | |
func Solution(answers []int) []int { | |
answer := []int{} | |
picker1 := [5]int{1, 2, 3, 4, 5} | |
picker2 := [8]int{2, 1, 2, 3, 2, 4, 2, 5} | |
picker3 := [10]int{3, 3, 1, 1, 2, 2, 4, 4, 5, 5} | |
correct := [3]int{0, 0, 0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package moketest | |
import ( | |
"reflect" | |
"testing" | |
) | |
func TestSolution(t *testing.T) { | |
cases := []struct { | |
in1, want []int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type tower struct { | |
idx int | |
height int | |
} | |
func solution(heights []int) []int { | |
dp := []tower{} | |
answer := []int{} | |
for i, v := range heights { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"io" | |
"os" | |
"strings" | |
) | |
type rot13Reader struct { | |
r io.Reader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"code.google.com/p/go-tour/tree" | |
"fmt" | |
) | |
func Walk(t *tree.Tree, ch chan int) { | |
_Walk(t, ch) | |
close(ch) | |
} |