There is a single direction linked list. Please give the 50th element from the end of the given list. 这道题考察的是单向链表的倒数第 k 个节点查找,核心思路通常是双指针:先让快指针向前走 50 步,然…
Question description Design and implement a tab component. The component should support switching between multiple tabs and displaying the corresponding…
What is the log order of the code above? Question description async function async1() { console.log(‘async1 start’); await async2(); console.log(‘async1…
TikTok is hosting a livestream event with popular creators. Each creator has submitted their preferred start and end times for their part in the livestr…
Given an array of data, where each entry is an object with id and value keys, and an object of ids, where each key is the name and value is either a sin…
You are given an integer array bills representing bills of different denominations and an integer amount representing a total amount of money. Return th…
Assignment: Write a piece of code which takes a single-channel grayscale image as an input and rotates it by 90 degrees. 这道题要求对一张单通道灰度图像进行 90 度旋转,本质上是对二…
You are given a network of n nodes represented as an n x n adjacency matrix graph , where graph[i][j] == 1 means the two nodes i and j are connected, an…
Cache Design Design a cache that supports the following two basic operations: set(id, object) : store an object by its id; get(id) : retrieve an object…
A binary matrix only has 0 or 1. For every element in the matrix, find the minimum number of steps to reach 1 (left, right, down, up). Input: [ [0, 1, 0…
Given an integer array nums and an integer k , return the k -th largest element in the array. Note that it is the k -th largest element in the sorted or…
Max Area of Island You are given an m x n binary matrix grid . An island is a group of 1 ‘s (representing land) connected 4-directionally (horizontally…
Problem Statement: Design a video lifecycle management system. A video may consist of different stages during its life cycle: Uploaded to TikTok Encoded…
Given an array of distinct integers candidates and a target integer target , return a list of all unique combinations of candidates where the chosen num…
Each word must be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same let…
We have a job definition as follows: from __future__ import annotations from dataclasses import dataclass from typing import List @dataclass class Job:…
Given an integer array nums , rotate the array to the right by k steps, where k is non-negative. Example 1: Input: nums = [1,2,3,4,5,6,7], k = 3 Output:…
Given two strings s and t of lengths m and n respectively, return the minimum window substring of s such that every character in t (including duplicates…
You are developing an online game where 2 users can play against each other. We want to create a service which will match users with similar ranks so th…
You are given a series of packages arranged on a conveyor belt. Each package has a specific weight, represented by the array weights , where the i th el…