原题链接:https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/ class Solution { public int lengthOfLongestSubstring(String s) { ...
分类:
其他好文 时间:
2020-12-25 11:54:02
阅读次数:
0
Given an array of integers, return the number of (contiguous, non empty) subarrays that have a sum divisible by . Example 1: Note: 1. `1 这道题给了一个数组,让返回 ...
分类:
编程语言 时间:
2020-12-25 11:49:15
阅读次数:
0
1 两数之和 直接n平方复杂度,双指针减少一层复杂度; 或者可以采用哈希表 class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { unordered_map<int, int> heap; for(i ...
分类:
编程语言 时间:
2020-12-25 11:48:25
阅读次数:
0
题目 给你一个字符串 s ,请你去除字符串中重复的字母,使得每个字母只出现一次。需保证 返回结果的字典序最小(要求不能打乱其他字符的相对位置)。 注意:该题与 1081 https://leetcode-cn.com/problems/smallest-subsequence-of-distinct ...
分类:
其他好文 时间:
2020-12-25 11:41:11
阅读次数:
0
给出一个 32 位的有符号整数,你需要将这个整数中每位上的数字进行反转。 示例 1: 输入: 123 输出: 321 示例 2: 输入: -123 输出: -321 示例 3: 输入: 120 输出: 21 注意: 假设我们的环境只能存储得下 32 位的有符号整数,则其数值范围为 [?231, 23 ...
分类:
其他好文 时间:
2020-12-24 11:45:02
阅读次数:
0
判断一个整数是否是回文数。回文数是指正序(从左向右)和倒序(从右向左)读都是一样的整数。 示例 1: 输入: 121 输出: true 示例 2: 输入: -121 输出: false 解释: 从左向右读, 为 -121 。 从右向左读, 为 121- 。因此它不是一个回文数。 示例 3: 输入: ...
分类:
其他好文 时间:
2020-12-24 11:40:53
阅读次数:
0
实现一个迷你的推特,支持下列几种方法 ?postTweet(user_id, tweet_text).? 发布一条推特. ?getTimeline(user_id).? 获得给定用户最新发布的十条推特,按照发布时间从最近的到之前排序 ?getNewsFeed(user_id).? 获得给定用户的朋友 ...
分类:
其他好文 时间:
2020-12-23 12:31:01
阅读次数:
0
请判断一个链表是否为回文链表。 示例 1: 输入: 1->2 输出: false 示例 2: 输入: 1->2->2->1 输出: true 进阶: 你能否用 O(n) 时间复杂度和 O(1) 空间复杂度解决此题? 来源:力扣(LeetCode) 链接:https://leetcode-cn.com ...
分类:
其他好文 时间:
2020-12-22 12:57:18
阅读次数:
0
地址 https://leetcode-cn.com/problems/wildcard-matching/ 给定一个字符串 (s) 和一个字符模式 (p) ,实现一个支持 '?' 和 '*' 的通配符匹配。 '?' 可以匹配任何单个字符。 '*' 可以匹配任意字符串(包括空字符串)。 两个字符串完 ...
分类:
其他好文 时间:
2020-12-22 12:50:42
阅读次数:
0
Write a SQL query to get the nth highest salary from the Employee table. + + + | Id | Salary | + + + | 1 | 100 | | 2 | 200 | | 3 | 300 | + + + For exa ...
分类:
其他好文 时间:
2020-12-22 12:23:32
阅读次数:
0