Find first non-repeated character in a string. Examples: AAABBBC , returns C . AAABBBCD , returns C . ABABABCD , returns C . 这道题要求在字符串中找出第一个只出现一次的字符,并返回…
Write a function that calculates the dot product of two vectors. 96% of vector components are zero. What is a good data structure for v1 , v2 so that yo…
When someone drags their finger across a phone’s keyboard, we can record the letters they intersected, creating a swype path . Given a swype path and a…
Question description Design and implement a tab component. The component should support switching between multiple tabs and displaying the corresponding…
Merge In Between Description Consider two linked lists, list1 and list2 , and two integers, i and j . Replace the nodes from the i th to the j th positi…
8-Puzzle Description The 8 Puzzle is a sliding block game played on a 3×3 grid containing 8 numbered tiles (from 1 to 8) and one empty space represented…
You and a friend have received a special gold chain as a gift. The chain links each have an integer weight, not necessarily the same. You and your frien…
Shopping Cart Billing An e-commerce company is currently celebrating ten years in business. They are having a sale to honor their privileged members, th…
Given a string s containing only lowercase English letters and parentheses, reverse the strings in each pair of matching parentheses from the innermost…
What is the log order of the code above? Question description async function async1() { console.log(‘async1 start’); await async2(); console.log(‘async1…
Please implement a Python function that takes a non-negative integer argument n as input, and it produces a list of all binary strings with length n suc…
Assume you work at a video streaming service and are asked to build a solution that will recommend videos to users on their home page. How would you app…
There are a total of numCourses courses you have to take, labeled from 0 to numCourses – 1 . You are given an array prerequisites where prerequisites[i]…
Given a mapping of teams to their data access patterns, and a list of deleted data files, determine which teams are impacted. Build a system that can: P…
Compare two strings and determine whether they are anagrams of each other. 这道题的核心是判断两个字符串是否由完全相同的字符组成,只是顺序不同。最常见的做法是先比较长度是否一致,如果长度不同就一定不是 anagram;然后用哈希表…
Design a rate limiter for an API. Discuss the functional requirements, non-functional requirements, API design, high-level architecture, and data model…