How To Find The Maximal Subarray Having Distinct Elements
A simple C++ solution to Leetcode 1695. Maximum Erasure Value using a sliding window approach and prefix sums.
Jan 9, 20242 min read251

Search for a command to run...
Articles tagged with #programming-tips
A simple C++ solution to Leetcode 1695. Maximum Erasure Value using a sliding window approach and prefix sums.

The math behind Leetcode 342. Power of Four.

Finding the first non-repeating character in a string

Median and std::nth_element

Problem statement A string s is called good if there are no two different characters in s that have the same frequency. Given a string s, return the minimum number of characters you need to delete to make s good. The frequency of a character in a str...

How to compare vectors
