ShareHub

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

CA 12 - Next Permutation

CA 12 - Next Permutation

Sigma Griffin · 3/22/2026

Problem Statement: here PS Understanding: We have to find the arrangement of numbers that is immediately bigger than the current one. Solution: def nextPermu...

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...