Блог пользователя itrator

Автор itrator, история, 21 месяц назад, По-английски
  • Проголосовать: нравится
  • +2
  • Проголосовать: не нравится

Автор itrator, история, 22 месяца назад, По-английски

Question : Given a String (Eg:aabbbbaa), for all the substrings find the difference between freq[c1] — freq[c2] where c1 is the maximum occurring character and c2 is the minimum occurring character of that substring and print the largest difference of all substring of the string.

if u didn't get the question the link is below : https://leetcode.com/problems/substring-with-largest-variance/

I saw many of the solutions but couldn't understand the main intuition of applying the kadane Algo.

any other approach or kadane approach ,can anyone explain !!!

Полный текст и комментарии »

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится