Home
Gaurav's GitHub Page
Cancel

Single Number II

Problem Description Given an integer array nums where every element appears three times except for one, which appears exactly once. Find the single element and return it. You must implement a sol...

Single Number I

Problem Description Given an array of integers A, every element appears twice except for one. Find that integer that occurs once. Solution public int singleNumber(final List<Integer> A) { ...

Single Number III

Problem Description Given an integer array nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once. You ca...

Introduction to Bit Manipulation - Part 4

Introduction to Bit Manipulation - Part 3

Introduction to Bit Manipulation - Part 2

Introduction to Bit Manipulation - Part 1

Counting Bits

This question is part of NeetCode150 series. Problem Description Given an integer n, return an array ans of length n + 1 such that for each i (0 <= i <= n), ans[i] is the number of 1’s in t...

Number of 1 Bits

This question is part of NeetCode150 series. Problem Description Write a function that takes an unsigned integer and returns the number of ‘1’ bits it has (also known as the Hamming weight). Not...

Longest Consecutive Sequence

This question is part of NeetCode150 series. Problem Description Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must write an algori...