Skip to content

LeetCode

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

Missing Number - 268

Missing Number – 268

🔗LC136 🟢 Easy 🧩 Pattern – XOR Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array. Example Solution Bitwise XOR operator ^ is the only way to solve this question, personally, I don’t… Read More »Missing Number – 268