LEETCODE
ABOOMMMMM
这个作者很懒,什么都没留下…
展开
-
回溯算法模板加总结
首先上回溯算法模板: public void backTrack(List<Integer> path,int[] 选择列表,int 索引) { if(满足终止条件) { ans.add(new LinkedList(path)); return; } for(元素 : 选择列表) { path.add(元素); backTrack(path,选择列表原创 2021-04-01 16:43:32 · 153 阅读 · 0 评论 -
滑动窗口算法模板LeetCode 76,567 Java
LeetCode 第76题模板 class Solution { public String minWindow(String s, String t) { int size = 0; int[] need = new int[128];//ascii表有128字符 int[] window = new int[128]; for(char c : t.toCharArray()) { if(need[c] ==原创 2021-03-10 15:03:51 · 136 阅读 · 0 评论 -
LEETCODE初级算法26.从排序数组中删除重复的数
#include <iostream> #include <vector> #include <string> using namespace std; //题目是排序数组,就是说是有顺序的 //那么就只用判断和后一位是不是相同的 class Solution { public: int removeDuplicates(vector<int>&...原创 2019-11-13 20:33:49 · 114 阅读 · 0 评论