/leetcode

Primary LanguagePython

Задачи с собеседований!

Я разбил задачи на группы по подходам, которые в них используются:

  1. Задачи про 3 суммы
  2. Задачи на бинарный поиск
  3. Задачи на графы
  4. Задачи на проектирование собственных классов
  5. Задачи про связные списки
  6. Задачи на префиксные суммы и предподсчет
  7. Задачи, использующие стек
  8. Задачи на работу со строками
  9. Задачи на два указателя
  10. Остальные задачи)

Теперь раскажу про каждую задачу отдельно:

1. 3sum (leetcode)

Условие:

2. 3sum Closest (leetcode)

Условие:

3. Binary search (leetcode)

Условие:

4. Find First and Last Position of Element in Sorted Array (leetcode)

Условие:

5. Find K Closest Elements (leetcode)

Условие:

6. Find Minimum in Rotated Sorted Array (leetcode)

Условие:

7. Median of Two Sorted Arrays (leetcode)

Условие:

8. Search a 2D Matrix (leetcode)

Условие:

9. Search in Rotated Sorted Array (leetcode)

Условие:

10. Balanced Binary Tree (leetcode)

Условие:

11. Binary Tree Level Order Traversal (leetcode)

Условие:

12. Binary Tree Zigzag Level Order Traversal (leetcode)

Условие:

13. Binary Tree Maximum Path Sum (leetcode)

Условие:

14. Find Duplicate Subtrees (leetcode)

Условие:

15. Lowest Common Ancestor of a Binary Search Tree (leetcode)

Условие:

16. Lowest Common Ancestor of a Binary Tree (leetcode)

Условие:

17. Lowest Common Ancestor of a Binary Tree III (leetcode)

Условие:

18. Maximum Depth of Binary Tree (leetcode)

Условие:

19. Number of Islands (leetcode)

Условие:

20. Range Sum of BST (leetcode)

Условие:

21. Reconstruct Itinerary (leetcode)

Условие:

22. Same Tree (leetcode)

Условие:

23. Serialize and Deserialize BST (leetcode)

Условие:

24. Sum of Left Leaves (leetcode)

Условие:

25. Symmetric Tree (leetcode)

Условие:

26. Validate Binary Search Tree (leetcode)

Условие:

27. Design an ATM Machine (leetcode)

Условие:

28. Design Hit Counter (leetcode)

Условие:

29. Flatten Nested List Iterator (leetcode)

Условие:

30. Implement Rand10() Using Rand7() (leetcode)

Условие:

31. Insert Delete GetRandom O(1) (leetcode)

Условие:

32. LRU Cache (leetcode)

Условие:

33. Max Stack (leetcode)

Условие:

34. Number of Recent Calls (leetcode)

Условие:

35. Implement Queue using Stacks (leetcode)

Условие:

36. Zigzag Iterator (leetcode)

Условие:

37. Add Two Numbers (leetcode)

Условие:

38. Linked List Cycle (leetcode)

Условие:

39. Merge k Sorted Lists (leetcode)

Условие:

40. Merge Two Sorted Lists (leetcode)

Условие:

41. Palindrome Linked List (leetcode)

Условие:

42. Remove Nth Node From End of List (leetcode)

Условие:

43. Reverse Linked List (leetcode)

Условие:

44. Continuous Subarray Sum (leetcode)

Условие:

45. Maximum Subarray (leetcode)

Условие:

46. Product of Array Except Self (leetcode)

Условие:

47. Subarray Sum Equals K (leetcode)

Условие:

48. Subarray Sums Divisible by K (leetcode)

Условие:

49. Evaluate Reverse Polish Notation (leetcode)

Условие:

50. Maximal Rectangle (leetcode)

Условие:

51. Simplify Path (leetcode)

Условие:

52. Valid Parentheses (leetcode)

Условие:

53. Consecutive Characters (leetcode)

Условие:

54. Find All Anagrams in a String (leetcode)

Условие:

55. Find the Index of the First Occurrence in a String (leetcode)

Условие:

56. First Unique Character in a String (leetcode)

Условие:

57. Is Subsequence (leetcode)

Условие:

58. Isomorphic Strings (leetcode)

Условие:

59. Longest Palindromic Substring (leetcode)

Условие:

60. Longest Repeating Character Replacement (leetcode)

Условие:

61. Longest Substring with At Most Two Distinct Characters (leetcode)

Условие:

62. Longest Substring Without Repeating Characters (leetcode)

Условие:

63. Multiply Strings (leetcode)

Условие:

64. One Edit Distance (leetcode)

Условие:

65. Partition Labels (leetcode)

Условие:

66. Permutation in String (leetcode)

Условие:

67. Reverse Words in a String III (leetcode)

Условие:

68. String Compression (leetcode)

Условие:

69. Valid Anagram (leetcode)

Условие:

70. Valid Palindrome (leetcode)

Условие:

71. Valid Palindrome II (leetcode)

Условие:

72. Best Time to Buy and Sell Stock (leetcode)

Условие:

73. Container With Most Water (leetcode)

Условие:

74. Longest Subarray of 1's After Deleting One Element (leetcode)

Условие:

75. Max Consecutive Ones II (leetcode)

Условие:

76. Max Consecutive Ones III (leetcode)

Условие:

77. Product of Two Run-Length Encoded Arrays (leetcode)

Условие:

78. Remove Duplicates from Sorted Array (leetcode)

Условие:

79. Shortest Unsorted Continuous Subarray (leetcode)

Условие:

80. Squares of a Sorted Array (leetcode)

Условие:

81. Summary Ranges (leetcode)

Условие:

82. Trapping Rain Water (leetcode)

Условие:

83. Two Sum II - Input Array Is Sorted (leetcode)

Условие:

84. Find the Difference of Two Arrays (leetcode)

Условие:

85. Find the Prefix Common Array of Two Arrays (leetcode)

Условие:

86. Generate Parentheses (leetcode)

Условие:

87. Group Anagrams (leetcode)

Условие:

88. Integer to Roman (leetcode)

Условие:

89. Intersection of Two Arrays II (leetcode)

Условие:

90. Interval List Intersections (leetcode)

Условие:

91. Jewels and Stones (leetcode)

Условие:

92. Line Reflection (leetcode)

Условие:

93. Matrix Diagonal Sum (leetcode)

Условие:

94. Maximize Distance to Closest Person (leetcode)

Условие:

95. Meeting Rooms (leetcode)

Условие:

96. Meeting Rooms II (leetcode)

Условие:

97. Merge Intervals (leetcode)

Условие:

98. Merge Sorted Array (leetcode)

Условие:

99. Missing Number (leetcode)

Условие:

100. Move Zeroes (leetcode)

Условие:

101. Number of Students Doing Homework at a Given Time (leetcode)

Условие:

102. Perfect Squares (leetcode)

Условие:

103. Roman to Integer (leetcode)

Условие:

104. Rotate Image (leetcode)

Условие:

105. Single Number (leetcode)

Условие:

106. Spiral Matrix II (leetcode)

Условие:

107. Top K Frequent Elements (leetcode)

Условие:

108. Top K Frequent Words (leetcode)

Условие:

109. Two Sum (leetcode)

Условие: