Input is a string and a maximum width length. If a word is too long to fit into one line, we change line and move it to the other line. Implement a Pyth…
Implement a FileStorage Library You are tasked with implementing a library for managing file storage in a cloud-based application. The library should al…
You are given a graph with X and Y axes. Each axis represents positive integers. We will plot a graph based on given X and Y points. Starting from (0,0)…
Goal Extract the vehicles with no associated vehicle parts. Requirements Expected column: vehicle_id 这道 SQL 题考查的是如何找出“没有匹配记录”的主表数据,核心思路通常是使用 LEFT JOIN 连…
Before you begin This challenge is about processing real-time data from a webhook hosted by the Massachusetts Bay Transportation Authority (MBTA). For c…
Implement a Merger class that accepts a batch of data from each sensor and merges the batches into a single output stream sorted by timestamp. We have N…
Legiana, a Lyft user, is reviewing his rides from a specific day. However, the application is not retrieving the complete data for the rides, and they a…
Q: Implement sum() so that the following expressions evaluate correctly: sum(1, 2, 3).sumOf(); // 6 sum(2, 3)(2).sumOf(); // 7 sum(1)(2)(3)(4).sumOf();…
Every unique item in the input appears exactly 3 times. Examples: [1, 1, 1] => true [1, 2, 3] => false Consider a cache-like data structure with operati…
Card game N players randomly draw 4 cards per person. Winning rule Same color Same number Sequential 这道题给出多人随机抽取 4 张牌的设定,需要根据手牌判断获胜条件是否满足:同色、同数字、或连续顺子。核…
Problem Description Input: N (1-20) Requirement: Count how many numbers with at most N digits do not contain consecutive digit 6 s. Example: 2, 0~99, in…
Assume you run a movie theater that has many auditoriums, and every day you need to schedule movies into those auditoriums. You want to schedule all mov…
Given a string s containing just the characters ( , ) , { , } , [ and ] , determine if the input string is valid. An input string is valid if: Open brac…
You are given an array of integers and another target integer as input. Your task is to return the index or indices of the target integer in the array a…
Given a string, return the longest recurring substring. 这道题要求在一个字符串中找出最长的重复子串,也就是在原串中至少出现两次的连续子串,并返回长度最长的那个。常见思路是结合后缀数组、后缀树,或者用二分答案配合哈希/滚动哈希来判断某个长度的子串是否…
National Park – BPC Definition: We are building a system that can track the campgrounds at a National Park as well as the attractions available for gues…
You can select any programming language. Implement a basic Pub/Sub following the given interface. // Interface interface Subscription { unsubscribe(): v…
You are to build a simple key-value store for storing integers (keys are strings, values are integers) and a global version number (integer). You will n…
We are designing a system for officers to check out a body worn camera from a pool of available cameras. We need an object to store a collection of came…