Leetcode - 137. Single Number II
Leetcode - 137. Single Number II 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. ...
Leetcode - 137. Single Number II 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. ...
Leetcode - 442. Find All Duplicates in an Array Given an integer array nums of length n where all the integers of nums are in the range [1, n] and each integer appears once or twice, retu...
Bit Manipulation Bit manipulation is a powerful technique often used in problem-solving, especially in competitive programming and algorithmic interviews. Here are some common topics related to bi...
Leetcode - Largest Unique Number(Premium) Given an array of integers, identify the highest value that appears only once in the array. If no such number exists, return -1. Solution type Solu...
Leetcode - 387. First Unique Character in a String Given a string s, find the first non-repeating character in it and return its index. If it does not exist, return -1. Solution func firstU...
Leetcode - 287. Find the Duplicate Number Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. There is only one repeated nu...
Leetcode - 448. Find All Numbers Disappeared in an Array Given an array nums of n integers where nums[i] is in the range [1, n], return an array of all the integers in the range [1, n] that do...
In-Place Cyclic Sort As we know, the input array contains numbers from the range 1 to n. We can use this fact to devise an efficient way to sort the numbers. Since all numbers are unique, we can t...
Stacks in Golang In Golang, a stack is a linear data structure that works on the Last-In-First-Out (LIFO) principle which means that the element which is pushed in the stack in last will be popp...
Leetcode - 206. Reverse Linked List Given the head of a singly linked list, reverse the list, and return the reversed list. Solution /** * Definition for singly-linked list. * type ListNo...