2020年3月27日

mybatis 动态sql

摘要: 首先定义queryVo 类 package com.itheima.domain; import java.util.List; public class QueryVo { private User user; private List<Integer> ids; public User getU 阅读全文

posted @ 2020-03-27 21:33 zsben 阅读(143) 评论(0) 推荐(0) 编辑

滑动窗口+substr+map——leetcode30

摘要: 设单位串长度为k,在母串上维护区间[l,r],右端点每次向右移动k,截取的长为k的字符串tmp,看字符串集里是否有这个串 如果没有,那么[l,r]这一整段都清空掉,l=r=r+k 如果有,那么进行滑动窗口,当且仅当[l,r]区间出现的每种单位串数量<=每种给定集合的单位串数量,l才不往右移动 同时维 阅读全文

posted @ 2020-03-27 19:24 zsben 阅读(163) 评论(0) 推荐(0) 编辑

dp+正则模拟——leetcode10

摘要: class Solution { public: bool dp[1005][1005]; char S[1005],P[1005]; bool isMatch(string s, string p) { int n=s.size(),m=p.size(); for(int i=0;i<n;i++) 阅读全文

posted @ 2020-03-27 16:02 zsben 阅读(154) 评论(0) 推荐(0) 编辑

思维+木桶理论+最小堆——leetcode407

摘要: 接雨水的二维版,先把最外层的边框围起来,然后逐步向内收缩边框,每次找边框的最低点,然后内(四个方向拓展) 如何统计每个点的贡献?由于木桶理论,该木桶内水的高度等于木桶边框的最低点,那么拓展时如果遇到边框小于当前边框,说明这个位置可以灌水,同时这个位置的高度也可以改成当前边框的高度 class Sol 阅读全文

posted @ 2020-03-27 14:27 zsben 阅读(235) 评论(0) 推荐(0) 编辑

导航