728x90
567. Permutation in String
-
[LeetCode] 567. Permutation in String c++Coding Test/LeetCode 2022. 12. 27. 18:00
문제 Given two strings s1 and s2, return true if s2 contains a permutation of s1, or false otherwise. In other words, return true if one of s1's permutations is the substring of s2. Input: s1 = "ab", s2 = "eidbaooo" Output: true Explanation: s2 contains one permutation of s1 ("ba"). 문제 해결 class Solution { public: bool checkInclusion(string s1, string s2) { if( s1.size() > s2.size()) return false; ..