Documentation ¶
Index ¶
- func GetSum(a, b int) int
- func IsPalindrome(s string) bool
- func IsPalindromeWithCompareStrings(s string) bool
- func IsPalindromeWithExtraSpace(s string) bool
- func IsPalindromeWithRE(s string) bool
- func ReorderList(head *ListNode)
- func Reverse(x int) int
- func TwoSum(nums []int, target int) []int
- type KthLargest
- type ListNode
- type MedianFinder
- type MedianFinderArray
- type MedianFinderHeap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsPalindrome ¶
IsPalindrome checks ASCII string without extra space
func IsPalindromeWithCompareStrings ¶
IsPalindromeWithCompareStrings checks ASCII string if reverse alphanameruc is equal
func IsPalindromeWithExtraSpace ¶
IsPalindromeWithExtraSpace checks ASCII string with building chars and comapre the chars from the same string It create an extra string to keep valid string
func IsPalindromeWithRE ¶
IsPalindromeWithRE checks ASCII string if reverse alphanameruc is equal
func ReorderList ¶
func ReorderList(head *ListNode)
func Reverse ¶
7. Reverse Integer
Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0. Assume the environment does not allow you to store 64-bit integers (signed or unsigned).
Example 1:
Input: x = 123 Output: 321
Example 2:
Input: x = -123 Output: -321
Example 3:
Input: x = 120 Output: 21
Constraints:
-2^31 <= x <= 2^31 - 1
Types ¶
type KthLargest ¶
type KthLargest struct {
// contains filtered or unexported fields
}
func Constructor ¶
func Constructor(k int, nums []int) KthLargest
func (*KthLargest) Add ¶
func (this *KthLargest) Add(val int) int
type MedianFinder ¶
func NewMedianFinder ¶
func NewMedianFinder(solution string) MedianFinder
type MedianFinderArray ¶
type MedianFinderArray struct {
// contains filtered or unexported fields
}
func (*MedianFinderArray) AddNum ¶
func (this *MedianFinderArray) AddNum(num int)
func (*MedianFinderArray) FindMedian ¶
func (this *MedianFinderArray) FindMedian() float64
type MedianFinderHeap ¶
type MedianFinderHeap struct {
// contains filtered or unexported fields
}
func (*MedianFinderHeap) AddNum ¶
func (this *MedianFinderHeap) AddNum(num int)
func (*MedianFinderHeap) FindMedian ¶
func (this *MedianFinderHeap) FindMedian() float64