ShareHub

Discover and share articles, posts, and links from across the web.

Majority Element

Majority Element

Prism Condor · 3/22/2026

Hi everyone! Today I solved a very interesting problem where we need to find the majority element in an array. The cool part is that it can be solved in O(n)...

Kadanes Algorithm

Kadanes Algorithm

Prism Condor · 3/22/2026

Problem Statement You are given an integer array arr[]. Your task is to find the maximum sum of a subarray (containing at least one element). Note: A subarra...