У нас вы можете посмотреть бесплатно String - 12: Check if String contains any permutation/anagram of given pattern | Java Implementation или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Source Code:https://thecodingsimplified.com/check... Solution: We create a map of frequency of characters present in pattern Now we start from 1st index & if that character present in map, then we decrease the frequency by 1 & we check if the frequency now becomes 0, then we increase the matchedElement variable by 1 If matchedElement becomes equal to size of map or unique characters in pattern then we've found our anagram & we return true Now if any element is moving out of window, we check if it's part of map, then increase the frequency by 1 & if the frequency is 0 then decrease the matchedElement by 1 At last, if there's no match found, then we return false Time Complexity: O(n + m) Space Complexity: O(m) CHECK OUT CODING SIMPLIFIED / codingsimplified ★☆★ VIEW THE BLOG POST: ★☆★ http://thecodingsimplified.com I started my YouTube channel, Coding Simplified, during Dec of 2015. Since then, I've published over 400+ videos. ★☆★ SUBSCRIBE TO ME ON YOUTUBE: ★☆★ https://www.youtube.com/codingsimplif... ★☆★ Send us mail at: ★☆★ Email: thecodingsimplified@gmail.com