Written test algorithm clearance (python implementation)

"The Road to Algorithm Clearance" study notes, record your own process of brushing the questions, please buy the author's book for detailed content.

The programming language I usually use the most is python. This blog is to record the topic and code of "The Road to Algorithm Clearance" while learning. There are some changes in the code, all the questions are from leetcode, covering almost all the question types in leetcode and our job-hunting written test.

chapter1 The Beauty of Mathematics

1-sum of two numbers, 15-sum of three numbers, 18-sum of four numbers, 454-sum of four numbers II, 16-sum of the nearest three numbers, 53-maximum subsequence sum, 179-maximum number , 166-fraction to decimal, 368-largest integer subset, 1175-prime number arrangement

chapter2 The Art of Palindrome

680-Verification Palindrome II, 234-Palindrome Linked List, 9-Palindrome Number, 5-Longest Palindrome Substring, 516-Longest Palindrome Subsequence, 906-Super Palindrome Number

chapter3 The Joy of Games

38-appearance array, 679-24 points, 37-solution of Sudoku, 289-game of life

chapter4 deep search and wide search

113-path sum II, 124-maximum path sum in binary tree, 200-number of islands, 305-number of islands II

chapter5 dichotomy

704-Binary search, 153-Find the minimum value in the rotation sorted array, 875-Ke Ke who loves to eat bananas, 69-The square root of x, 162-Find the peak value, 410-The maximum value of the split array

chapter6 bit operations

191-number of 1, 371-sum of two integers, 397-integer replacement, 136-number that appears only once, 137-number II that appears only once, 260-number III that appears only once

chapter7Design

155-minimum stack, 208-implement Trie (prefix tree), 146-LRU cache, 460-LFU cache, 1206-design jump table

chapter8 double pointer

11-The container with the most water, 3-The longest substring without repeated characters

chapter9 dynamic programming

70-climbing stairs, 198-robbery house, 213-robbery house II, 62-different paths, 322-money exchange, 518-money exchange II

chapter10 sliding window

239-Maximum value of sliding window, 76-Minimum covering substring, 424-Longest repeated character after replacement, 567-Arrangement of strings

Chapter11 game problem

877-Pebble Game, 486-Predict Winner, 292-Nim Game, 375-Guess the Number II

chapter12 stock question

121-The best time to buy and sell stocks, 122-The best time to buy and sell stocks II, 714-The best time to buy and sell stocks includes handling fees, 309-The best time to buy and sell stocks includes a freezing period, 188-The best time to buy and sell stocks IV, 123-The best time to buy and sell stocks III

chapter13 divide and conquer

23-Merge K ascending linked lists, 215-K largest element in the array, 240-Search two-dimensional matrix II

chapter14 greedy method

455-distribute cookies, 55-jump game, 621-task scheduler, 135-distribute candy, 435-no overlapping interval

chapter15 backtracking method

46-full permutation, 47-full permutation II, 39-combined sum, 40-combined sum II, 78-subset, 90-subset II

Dig a hole first, and then summarize the templates of each question type. Students who have questions and objections to the questions and codes are welcome to communicate and correct!

GitHub Notebook

Guess you like

Origin blog.csdn.net/cjw838982809/article/details/131977837