Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's permutations is the substring of the second string.

Example 1:

Input:s1 = "ab" s2 = "eidbaooo"
Output:True
Explanation: s2 contains one permutation of s1 ("ba").

Example 2:

Input:s1= "ab" s2 = "eidboaoo"
Output: False

Note:

  1. The input strings only contain lower case letters.
  2. The length of both given strings is in range [1, 10,000].

LeetCode567. Permutation in String的更多相关文章

  1. 567. Permutation in String

    Problem statement: Given two strings s1 and s2, write a function to return true if s2 contains the p ...

  2. [Swift]LeetCode567. 字符串的排列 | Permutation in String

    Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. I ...

  3. [LeetCode] Permutation in String 字符串中的全排列

    Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. I ...

  4. 567. Permutation in String判断某字符串中是否存在另一个字符串的Permutation

    [抄题]: Given two strings s1 and s2, write a function to return true if s2 contains the permutation of ...

  5. 60. Permutation Sequence (String; Math)

    The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the p ...

  6. LeetCode Permutation in String

    原题链接在这里:https://leetcode.com/problems/permutation-in-string/description/ 题目: Given two strings s1 an ...

  7. [LeetCode] 567. Permutation in String 字符串中的全排列

    Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. I ...

  8. 567. Permutation in String【滑动窗口】

    Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. I ...

  9. 【LeetCode】567. Permutation in String 解题报告(Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/permutati ...

随机推荐

  1. 【Linux】debian 7 安装 rz sz lrzsz

    通常linux服务器是通过ssh客户端来进行远程登录和管理的.然而如何方便的实现客户端与linux服务器端的文件交互呢?这就需要用到rz(上传).sz(下载)工具.在Ubuntu 10.10下安装rz ...

  2. CentOS7安装Nginx实现API网关

    参考 http://nginx.org/ http://nginx.org/en/linux_packages.html#stable https://www.npmjs.com/package/js ...

  3. 5.vs的各个组成部分

    启动vs (1).双击vs的打开图标 (2).输入devenv 编写项目时,命名的时候,尽量不要使用中文. 我们暂时将.cs文件理解为是一个类文件.   在 视图菜单 下可以打开 解决方案资源管理器 ...

  4. python3线程介绍01(如何启动和调用线程)

    #!/usr/bin/env python# -*- coding:utf-8 -*- import osimport time,randomimport threading # 1-进程说明# 进程 ...

  5. 为什么要使用TLSv1.2和System SSL?

    FTP 和 Telnet 正是核心联网应用程序的两个示例.为 System SSL 编程接口编码的供应商应用程序可以通过更改代码来利用这些新支持. 这是安全套接层 (SSL) 协议的最新版本,也是最为 ...

  6. Html + JS : 点击对应的按钮,进行选择是隐藏还是显示(用户回复功能)

    例如: 当我点击按钮1时,点击第一下进行显示This is comment 01,点击第二下隐藏This is comment 01 当我点击按钮2时,点击第一下进行显示This is comment ...

  7. ubuntu 安装 deb 软件包

    参考链接地址 blog.csdn.net/kevinhg/article/details/5934462 sudo dpkg -i xxxx.deb 安装一个 Debian 软件包,如你手动下载的文件

  8. 网页打开速度优化——HTTP请求头及响应头

    no-cache:不缓存过期的资源 no-store:不缓存 最近看了<图解HTTP>这本书,书上讲到了这两者的区别: no-cache从字面意义上很容易误解为不缓存,但是no-cache ...

  9. .net core 操作域控 活动目录 ladp -- Support for System.DirectoryServices for Windows

    原文链接:https://github.com/dotnet/corefx/issues/2089 1. @ianhays to kick start the project in CoreFX re ...

  10. String Painter, Chengdu 2008, LA4394

    题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_ ...