摘要: 给定一个数组,没有重复元素,要将其排列为一小一大一小一大, 比如: [8,6,7,3,4,5] 结果是: [6,8,3,7,4,5] [1,2,3,4,5] 结果是: [1,3,2,5,4] one pass void sort(int[] arr) { for(int i = 0; i < arr 阅读全文
posted @ 2024-03-31 00:29 xiaoyongyong 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 2007. Find Original Array From Doubled Array An integer array original is transformed into a doubled array changed by appending twice the value of eve 阅读全文
posted @ 2024-03-03 04:16 xiaoyongyong 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 378. Kth Smallest Element in a Sorted Matrix Solved Medium Topics Companies Given an n x n matrix where each of the rows and columns is sorted in asce 阅读全文
posted @ 2024-02-19 13:53 xiaoyongyong 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 149. Max Points on a Line Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane, return the maximum number of points 阅读全文
posted @ 2024-02-18 07:51 xiaoyongyong 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 2484. Count Palindromic Subsequences Given a string of digits s, return the number of palindromic subsequences of s having length 5. Since the answer 阅读全文
posted @ 2024-02-18 06:39 xiaoyongyong 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 31. Next Permutation Medium 168634309Add to ListShare A permutation of an array of integers is an arrangement of its members into a sequence or linear 阅读全文
posted @ 2023-09-10 08:05 xiaoyongyong 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 1235. Maximum Profit in Job Scheduling Hard 539662Add to ListShare We have n jobs, where every job is scheduled to be done from startTime[i] to endTim 阅读全文
posted @ 2023-09-05 06:34 xiaoyongyong 阅读(3) 评论(0) 推荐(0) 编辑
摘要: Given an array of n elements, where each element is at most k away from its target position, you need to sort the array optimally. Example 1: Input: n 阅读全文
posted @ 2023-09-05 03:26 xiaoyongyong 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 273. Integer to English Words Hard 27865945Add to ListShare Convert a non-negative integer num to its English words representation. Example 1: Input: 阅读全文
posted @ 2023-08-28 02:07 xiaoyongyong 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 7. Reverse Integer Medium Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 阅读全文
posted @ 2023-07-20 23:24 xiaoyongyong 阅读(6) 评论(0) 推荐(0) 编辑