Skip to content

DSA

Algorithms, Data Structures, Competitive Coding, and problems from LeetCode with complete Solution Approach, Pseudocode, and Explanation.

Unique Pairs with Target Sum

Unique Pairs with Target Sum

🟢 Easy 🧩 Pattern – Arrays and Hashmap Given an array of distinct integers and a target sum, return an array of unique pairs of numbers which add up to the target sum. Each pair should be represented as an array containing only two numbers. Example Solution

Majority Element - 169

Majority Element – 169

🔗LC169 🟢 Easy 🧩 Pattern – Arrays and Hashmap Given an array nums of size n, return the majority element. The majority element is the element that appears more than ⌊n / 2⌋ times. You may assume that the majority element always exists in the array. Example Solution