随笔分类 - 算法
本分类用于存放一些算法题,主要来源于Leetcode。
摘要:题目 Write a function that reverses a string. The input string is given as an array of characters s. You must do this by modifying the input array in-pl
阅读全文
摘要:题目 Given a 1-indexed array of integers numbers that is already *sorted in non-decreasing order*, find two numbers such that they add up to a specific
阅读全文
摘要:题目 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 thi
阅读全文
摘要:题目 Given an array, 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: [5,6,7,1
阅读全文
摘要:题目 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
阅读全文
摘要:题目 Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be i
阅读全文
摘要:题目 You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the qualit
阅读全文
摘要:题目 Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exi
阅读全文
摘要:题目 Calculate a + b Input The input will consist of a series of pairs of integers a and b,separated by a space, one pair of integers per line. Output F
阅读全文
摘要:题目 Chenjb is the task author of the 71-st Zhejiang Provincial Collegiate Programming Contest. He created an NP-Hard problem on a graph with n vertices
阅读全文

浙公网安备 33010602011771号