## Koko Eating Bananas | Binary Search

Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours. Koko can decide her bananas-per-hour eating speed of k. Each hour, she chooses some pile of bananas and eats k bananas from that pile. If the pile has less than k bananas, she eats all of them instead and will not eat any ......

## Find First and Last Position of Element in Sorted Array | Binary Search

Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found in the array, return[-1, -1]. You must write an algorithm with O(log n) runtime complexity. https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array......

## Binary Search

Description Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then return its index. Otherwise, return -1. You must write an algorithm with O(log n) runtime complexity. https://leetcode.com/problems/binary-search/ Code submit code class Solution: def search(self, nums: L......

## Longest Substring Without Repeating Characters | Sliding Windows

Descreption Given a string s, find the length of the longest substring without repeating characters. https://leetcode.com/problems/longest-substring-without-repeating-characters/ Solution sliding windows, The most import things is how to get The max. Code submit code class Solution: def lengthOfLongestSubstring(self, ......

## Find All Anagrams in a String | Sliding Windows

Desciption Given two strings s and p, return an array of all the start indices of p\'s anagrams in s. You may return the answer in any order. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. Input: s = "cbaebabacd", p = "abc" Output: [0,6] Explanation: The ......

## Minimum Window Substring

Description Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates) is included in the window. If there is no such substring, return the empty string "". The testcases will be generated such that the answer is unique. A substring is a contiguous sequence of characters with......

## Permutation in String

Desciption Given two strings s1 and s2, return true if s2 contains a permutation of s1, or false otherwise. In other words, return true if one of s1's permutations is the substring of s2. Input: s1 = "ab", s2 = "eidbaooo" Output: true Explanation: s2 contains one permutation of s1 ("ba"). https://leetcode.com/problems/permutation-in-string/ Thought Slide Win......

## Reverse String

Desciption Write a function that reverses a string. The input string is given as an array of characters s. You must do this by modifying the input array in-place with O(1) extra memory. Thought Two Pointer Code class Solution: def reverseString(self, s: List[str]) -> None: """ Do not return anything, modify s in-place instead. """ # s.......

## 删除链表的倒数第 N 个结点 | 双指针

 阿里云国际版 20美元 Vultr 10美元 搬瓦工 | Bandwagon 应该有折扣吧？ Just My Socks JMS9272283 【注意手动复制去跳转】 域名 | namesilo `emperinter`(1美元) 币安 币安