随笔分类 -  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 阅读全文
posted @ 2024-08-05 05:40 北叶青藤 阅读(7) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-07-06 11:04 北叶青藤 阅读(53) 评论(0) 推荐(0)
摘要:You are given a data structure of employee information, which includes the employee's unique id, their importance value and their direct subordinates' 阅读全文
posted @ 2021-04-12 23:22 北叶青藤 阅读(59) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-04-09 22:47 北叶青藤 阅读(72) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-04-08 00:15 北叶青藤 阅读(47) 评论(0) 推荐(0)
摘要: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:  阅读全文
posted @ 2021-03-29 06:09 北叶青藤 阅读(63) 评论(0) 推荐(0)
摘要:Given a string S of '(' and ')' parentheses, we add the minimum number of parentheses ( '(' or ')', and in any positions ) so that the resulting paren 阅读全文
posted @ 2021-03-29 05:13 北叶青藤 阅读(41) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-16 22:14 北叶青藤 阅读(182) 评论(0) 推荐(0)
摘要:Given an unsorted array of integers nums, return the length of the longest continuous increasing subsequence (i.e. subarray). The subsequence must be  阅读全文
posted @ 2021-03-14 12:43 北叶青藤 阅读(65) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-13 14:26 北叶青藤 阅读(83) 评论(0) 推荐(0)
摘要: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- 阅读全文
posted @ 2021-03-13 07:13 北叶青藤 阅读(36) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2021-03-11 02:23 北叶青藤 阅读(51) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-12-06 05:34 北叶青藤 阅读(81) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-12-01 12:30 北叶青藤 阅读(101) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-02-18 07:30 北叶青藤 阅读(172) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-02-18 07:08 北叶青藤 阅读(140) 评论(0) 推荐(0)
摘要:Given a string S of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them. We repeatedly make 阅读全文
posted @ 2020-02-07 08:18 北叶青藤 阅读(147) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-02-07 08:11 北叶青藤 阅读(135) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-02-07 07:50 北叶青藤 阅读(274) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-02-07 06:38 北叶青藤 阅读(172) 评论(0) 推荐(0)