LeetCode 1366. Rank Teams by Votes – Java
Problem Statement In a special ranking system, each voter gives a rank from highest to lowest to all teams participating in the competition. The ordering of teams is decided by … Read More
Problem Statement In a special ranking system, each voter gives a rank from highest to lowest to all teams participating in the competition. The ordering of teams is decided by … Read More
Problem statement We are given an array asteroids of integers representing asteroids in a row. For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning … Read More
121. Best Time to Buy and Sell Stock – Solution You are given an array prices where prices[i] is the price of a given stock on the ith day. You want to maximize your profit by … Read More
Problem: Two Sum | LeetCode Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would … Read More
Given an integer array nums, return the maximum difference between two successive elements in their sorted form. If the array contains less than two elements, return 0. You must write an algorithm that … Read More
Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string “”. Example 1: Input: strs = … Read More
Given an integer array nums, move all 0‘s to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy … Read More
Problem statement: Number of Recent calls You have a RecentCounter class which counts the number of recent requests within a certain time frame. Implement the RecentCounter class: RecentCounter() Initializes the counter with zero recent requests. … Read More