Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Abs ¶
There are three types of edits that can be performed on strings: Insert a character, remove a character, or replace a character. Given two strings, write a function to check if they are one edit (or zero edits) away.
for exmaple:
- pale, ple √ 1 char removed
- pales, pale √ 1 char removed
- pale, bale √ 1 char replaced
- pale, bake X 2 chars replaced
- pae, pale √ 1 char removed
This has an O(n) runtime
func ArePermutations ¶
func ArrayToString ¶
Types ¶
type Pixel ¶
type Pixel struct {
// contains filtered or unexported fields
}
Given an image represented by an NxN matrix, where each pixel in the image is 4 bytes, write a method to rotate the image by 90 degrees. Can you do this in place?
I like to show this in a picture so that I can spot the pattern.
For example:
This can represent the 2x2 image array. [
[ a, b ], [ c, d ]
]
What we want is: [
[ c, a ], [ d, b ]
]
The coordinates change from, to:
00 -> 01 01 -> 11 11 -> 10 10 -> 00
Click to show internal directories.
Click to hide internal directories.