Search results
Asteroid Collision - 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 right, negative meaning left). Each asteroid moves at the same speed.
Asteroid Collision. 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 right, negative meaning left). Each asteroid moves at the same speed.
Asteroid Collision - LeetCode. Can you solve this real interview question? Asteroid Collision - Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
Return the sum of all subarray ranges of nums. A subarray is a contiguous non-empty sequence of elements within an array. Example 1: Input: nums = [1,2,3] Output: 4. Explanation: The 6 subarrays of nums are the following: [1], range = largest - smallest = 1 - 1 = 0. [2], range = 2 - 2 = 0. [3], range = 3 - 3 = 0.
Destroying Asteroids - You are given an integer mass, which represents the original mass of a planet. You are further given an integer array asteroids, where asteroids [i] is the mass of the ith asteroid.
Return the total number of collisions that will happen on the road. Example 1: Input: directions = "RLRSLL" Output: 5 Explanation: The collisions that will happen on the road are: - Cars 0 and 1 will collide with each other. Since they are moving in opposite directions, the number of collisions becomes 0 + 2 = 2.
Shortest Bridge. Medium. You are given an n x n binary matrix grid where 1 represents land and 0 represents water. An island is a 4-directionally connected group of 1 's not connected to any other 1 's. There are exactly two islands in grid. You may change 0 's to 1 's to connect the two islands to form one island.
Robot Collisions - There are n 1-indexed robots, each having a position on a line, health, and movement direction. You are given 0-indexed integer arrays positions, healths, and a string directions (directions [i] is either 'L' for left or 'R' for right). All integers in positions are unique.
LeetCode - The World's Leading Online Programming Learning Platform. Sorry, there are no medals to grab right now. Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
Predict which party will finally announce the victory and change the Dota2 game. The output should be "Radiant" or "Dire". Example 1: Input: senate = "RD" Output: "Radiant" Explanation: The first senator comes from Radiant and he can just ban the next senator's right in round 1.