start = 0, end = 0, count = 0 iterate till first k size window reached: increment end and keep adding to set 1st window size reached - check for distinct when window size==k, check all the k chars ...
Many developers share their LeetCode solutions on GitHub. Look for repositories that are well-organized by topic or problem number, have clear explanations, and show good code quality. Some popular ...
1. partition the array in blocks of size w=4. The last block may have less then w. 2. Traverse the list from start to end and calculate max_so_far. Reset max after each block boundary (of w elements).