随笔分类 - Level 1
摘要:Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this i
阅读全文
摘要:You are given a string s representing an attendance record for a student where each character signifies whether the student was absent, late, or prese
阅读全文
摘要:You are given a data structure of employee information, which includes the employee's unique id, their importance value and their direct subordinates'
阅读全文
摘要:A permutation perm of n + 1 integers of all the integers in the range [0, n] can be represented as a string s of length n where: s[i] == 'I' if perm[i
阅读全文
摘要:Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order. Example 1: I
阅读全文
摘要:Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array. Follow up:
阅读全文
摘要:Given a string S of '(' and ')' parentheses, we add the minimum number of parentheses ( '(' or ')', and in any positions ) so that the resulting paren
阅读全文
摘要:There are n buildings in a line. You are given an integer array heights of size n that represents the heights of the buildings in the line. The ocean
阅读全文
摘要:Given an unsorted array of integers nums, return the length of the longest continuous increasing subsequence (i.e. subarray). The subsequence must be
阅读全文
摘要:Given three integer arrays arr1, arr2 and arr3 sorted in strictly increasing order, return a sorted array of only the integers that appeared in all th
阅读全文
摘要:Given an m x n matrix, return true if the matrix is Toeplitz. Otherwise, return false. A matrix is Toeplitz if every diagonal from top-left to bottom-
阅读全文
摘要:Given an array of characters chars, compress it using the following algorithm: Begin with an empty string s. For each group of consecutive repeating c
阅读全文
摘要:Given an integer array arr. You have to sort the integers in the array in ascending order by the number of 1's in their binary representation and in c
阅读全文
摘要:Write a function that takes an unsigned integer and returns the number of '1' bits it has (also known as the Hamming weight). Note: Note that in some
阅读全文
摘要:Given an n-ary tree, return the level order traversal of its nodes' values. Nary-Tree input serialization is represented in their level order traversa
阅读全文
摘要:Imagine you have an array like this (note that the array has duplicates, and includes 0 and k): a = [ 4, 64, 200, 42, 56, 22, 1, 64, 0, 161, 200, 0, 4
阅读全文
摘要:Given a string S of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them. We repeatedly make
阅读全文
摘要:Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 whic
阅读全文
摘要:Given the root node of a binary search tree, return the sum of values of all nodes with value between L and R (inclusive). The binary search tree is g
阅读全文
摘要:Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2. Note: The length of both num1 and num2 is < 5100
阅读全文

浙公网安备 33010602011771号