Given a non-negative integer num represented as a string, remove k digits from the number so that the new number ...
移除K位数字 题目: . 移掉K位数字 题目描述: 给定一个以字符串表示的非负整数 num,移除这个数中的 k 位数字,使得剩下的数字最小。 num 的长度小于 且 k。 num 不会包含任何前导零。 示例 : 解题思路:基于单调栈的贪心算法 对于两个长度相同的数字,其最左边的数字决定了这两个数字的大小,左边的数字越小,数字也越小,比如如果由相同的元素组成的数字,升序序列是最小的。所以我们的想法 ...
2020-03-24 18:05 0 596 推荐指数:
Given a non-negative integer num represented as a string, remove k digits from the number so that the new number ...
Given several boxes with different colors represented by different positive numbers. You may expe ...
Given a C++ program, remove comments from it. The program source is an array where source[i] is t ...
You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k. Define a pair (u,v) which consists of one element ...
Given integers n and k, find the lexicographically k-th smallest integer in the range from 1 to n. Note: 1 ≤ k ≤ n ≤ 109. Example: 这道题是之前 ...
Start from integer 1, remove any integer that contains 9 such as 9, 19, 29... So now, y ...
Given an array A of integers, return the number of (contiguous, non-empty) subarrays that have a sum divisible by K. Example 1: Note: 1 < ...
//给你两个 非空 的链表,表示两个非负的整数。它们每位数字都是按照 逆序 的方式存储的,并且每个节点只能存储 一位 数字。 // // 请你将两个数相加,并以相同形式返回一个表示和的链表。 // // 你可以假设除了数字 0 之外,这两个数都不会以 0 开头。 // // // // 示例 ...