LeetCode: Best Time to Buy and Sell Stock Solution in C

You are given an array of prices where prices[i] is the price of a given stock on an ith day. …

LeetCode: Intersection of Two Arrays in C

Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must appear …

HackerLand University has the following grading policy: Every student receives a grade in the inclusive range from to 0 to …

LeetCode: Merge Sorted Arrays

You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing …

LeetCode Two Sum Solution

Given an array of integers nums and an integer target, return indices of the two numbers such that they add …

Maximum Subarray Solution

In this tutorial, we will learn to find a solution to a maximum subarray problem using C and C++. First, …

C program to Reverse an Integer Number/ Program for Reverse Number in C

This C program can reverse an integer. For example, this program reads 1234 and converts it into 4321. Method: 1 …

80. Remove Duplicates from Sorted Array II

Given an integer array of nums sorted in non-decreasing order, remove some duplicates in-place such that each unique element appears …

Remove Duplicates from Sorted Array

In this tutorial, we will write a simple c program to remove duplicate elements from a sorted array. In order …

Lonely Integer: Given an array of integers, where all elements but one occur twice, find the unique element.

Link to the original problem: Here