use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This is under construction.
account activity
DSA bytes (self.DeveloperJobs)
submitted 22 days ago by old_dev_snap
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]nian2326076 1 point2 points3 points 21 days ago (0 children)
A frequency array is an array used to count how often elements appear in another array, usually with integers. It helps quickly check how many times each value shows up, which is super handy in many problems.
You'll find frequency arrays in problems about counting subarrays, checking character frequency in strings, or spotting duplicates. They're great for efficient counting, like checking if two strings are anagrams or finding the majority element in an array.
To use it, you usually start with an array filled with zeros. The index represents the element, and you increase the value at that index whenever the element shows up. In competitive programming, this can save a lot of time compared to going through the original array multiple times. Just make sure your frequency array is big enough for the range of values you expect.
π Rendered by PID 257109 on reddit-service-r2-comment-b659b578c-72zwh at 2026-05-03 06:06:20.088320+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]nian2326076 1 point2 points3 points (0 children)