# HackerEarth Streak: An exciting data about your HackerEarth activity

DevFeed: [HackerEarth Streak: An exciting data about your HackerEarth activity](<https://devfeed.tech/articles/hackerearth-streak-an-exciting-data-about-your-hackerearth-activity-19991.md>)

Original publisher: [Read original article](<http://engineering.hackerearth.com/2014/06/18/hackerearth-streak-an-exciting-data-about-your-hackerearth-activity/>)

Published: 2014-06-18T00:00:00Z

Content type: article

Language: en

Sources: [HackerEarth](<https://devfeed.tech/sources/hackerearth.md>)

Topics: [data](<https://devfeed.tech/topics/data.md>), [Code](<https://devfeed.tech/topics/code.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [Data structures](<https://devfeed.tech/topics/data-structures.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [data](<https://devfeed.tech/tags/data.md>), [developer](<https://devfeed.tech/tags/developer.md>), [programming](<https://devfeed.tech/tags/programming.md>)

## AI overview

The article explains how HackerEarth calculates Code Streak and Day Streak for a developer activity profile. For Code Streak, it identifies problem type and ID, checks whether submissions were correct, counts unique problems across ranges of correct submissions, and uses hashing to avoid counting a problem more than once. The supplied text begins the Day Streak discussion but does not provide its complete method.

## Source excerpt

We have been constantly adding features to our HackerEarth Developer Profile, making it better with every new update. One of the exciting data in it is HackerEarth Streak on the HackerEarth Activity page. This post explains how we process user data and compute such results. We split it into two parts: Code Streak: Maximum number of unique problems solved continuously Day Streak: Maximum number of days such that one new problem is solved each day Code Streak: Extracting Relevant Data All we have is the data about all the submissions made by any user. In order to process Code Streak we need to identify two things. To which problem the submission was made to? Now we have several different types of Problems in Challenges and Practice Problem. For eg: Programming Problem, Approximate Problem, Golf Problem etc. Each problem is assigned two attributes. Type (Programming Problem, Approximate Problem, Golf Problem etc) and ID (1,2,3 and so on). So in order to uniquely identify any problem we need both the attributes, because a Programming Problem can have the same ID as Approximate Problem, the difference is in the Type. Was the submission graded Correct or Incorrect? This is directly accessible from a single boolean attribute Solved which is True if Correct and False if Incorrect. Now that we have extracted the data enough to calculate Code Streak, we move to the Data Structure part. Solution - The Data Structure behind Recently there was a question inspired from Code Streak in June Easy Challenge as Roy and Code Streak. It was simplified and ID ranges were restricted to convert the problem into easier one. A linear DP (Dynamic Programming) solution was enough to solve the problem. Algorithm steps are as follows: Find all the ranges of Correct submissions For each range, count all the unique problems which have never been solved before Store the count in an array Find the maximum from the array The second point is the challenge here. How do we know whether the problem with