• LeetCode 567. 字符串的排列


    解题思路

    滑动窗口的经典例题,直接套模板。

    相关代码

    class Solution {
        int hash1[] = new int[26];
        int hash2[] = new int[26];
        public boolean checkInclusion(String s1, String s2) {    
            for(int i=0;ik){
                    hash2[a[j]-'a']--;
                    j++;
                }
                if(i>=k-1&&equals(hash1, hash2)) return true; 
            }
            return false;
        }
    
        public boolean equals(int s1[],int s2[]){
            if(s1.length!=s2.length) return false;
            for(int i=0;i
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
  • 相关阅读:
    计算机毕业设计node.js+Vue+Element企业员工信息管理系统
    python项目制作docker镜像,加装引用模块,部署运行!
    JAVA:实现Blowfish区块加密算法(附完整源码)
    C#数组简单介绍
    js的File对象,Blob和file相互转换
    ClickHouse副本节点数据损坏恢复
    crypto:丢失的MD5
    字符串常量池(String Table)
    基于JSP实现校园二手交易平台
    计算机毕业设计springboot驾校学员管理系统w42sj源码+系统+程序+lw文档+部署
  • 原文地址:https://blog.csdn.net/weixin_55057111/article/details/136772374