Documentation
¶
Index ¶
Constants ¶
View Source
const ( MaxInt = 1<<(UintSize-1) - 1 // 1<<31 - 1 or 1<<63 - 1 MinInt = -MaxInt - 1 // -1 << 31 or -1 << 63 MaxUint = 1<<UintSize - 1 // 1<<32 - 1 or 1<<64 - 1 )
View Source
const UintSize = 32 << (^uint(0) >> 32 & 1) // 32 or 64
Variables ¶
This section is empty.
Functions ¶
func IsPalindrome ¶
IsPalindrome returns True if given string is a palindrome uses a two pointers which start from both ends of the string comparing and moving towards the middle of the string O(n) time, O(1) space
func MinimumWindowSort ¶
mimimumwindowsort find minumum window when sorted will sort the whole slice two pointers approach O(n) time and O(1) space
func TwoNumberTargetSum ¶
two_numbers_target_sum given slice and target return true if 2 numbers sum up to the target O(n) time and O(n) space
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.