Version Sort Versions is a version number list for a project. Because many people maintain it, the format is irregular. Given an array of version string…
Amazon sells millions of products on its website, and for better customer experience, it wants to show a widget with the most popular items bought on th…
Given N free bytes in the memory, implement the following two functions. malloc(k) : allocates a block of k bytes of memory and returns a pointer to the…
You are given a 0-indexed integer array nums of even length consisting of an equal number of positive and negative integers. You should return the array…
Problem: Numbers, arrange them such that negative numbers are to the left of 0 and positive numbers are to the right of 0. The goal is to rearrange the…
Title Evaluate Division Question description You are given an array of variable pairs equations and an array of real numbers values, where equations[i]…
Create an online match-making algorithm that receives players and dispatches a call to a game server when it finds players with ratings close enough to…
Build a React app that displays a counter starting at 0 . Requirements: Show the text You clicked {count} times . Render a button labeled Click Me . Whe…
You are given a list of calls, where each call has a type such as search , tts , or db.lookup . Each call type has a cooldown period. There are m time s…
Given an unsorted list of products with their departments and a shopping list, return the time saved in terms of the number of department visits elimina…
Given a string S consisting of lowercase English characters, determine if you can make it a palindrome by removing at most 1 character. Examples: tacoca…
Given an array of integers (0 to 9), rearrange the positions of the array elements to represent the second largest possible number. Example 1: Input: [1…
X = player1, Y = player2. Given a 2D matrix and a position, return whether one of the players is surrounded by the other player. 这道题的核心是把二维矩阵中的“包围”关系转化为…
Network of routers: each router has an (x, y) coordinate. A message can be broadcast from one router to another if the Euclidean distance between them i…
Given an array of positive integers nums and an integer k , return true if nums has a continuous subarray whose sum equals k . Examples: nums = [1,2,3,4…
Question 1: You are given two arrays with positive integers arr1 and arr2 . A prefix of a positive integer is an integer formed by one or more of its di…
Implement a mock of the Unix cd (change directory) command. The code does not have to change actual directories; it only needs to return the new path af…
Design a system that supports the following operations: A user can create a new post and attach one or more hashtags to it. A user can search for posts…
Design a String Compress(string input) system. The system should support compressing an input string and later decompressing it back to the original for…