题目 There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted…
标签:LeetCode
leetcode136. 只出现一次的数字
给定一个非空整数数组,除了某个元素只出现一次以外,其余每个元素均出现两次。找出那个只出现了一次的元素。 说明: 你的算法应该具有线性时间复杂度。 你可以不使用额外空间来实现吗? 示例 1: 输入: [2,2,1] 输出:…
leetcode刷题笔记-stack
394. Decode String Given an encoded string, return it’s decoded string. The encoding rule is: …
【Leetcode 做题学算法周刊】第一期
首发于微信公众号《前端成长记》,写于 2019.10.28 背景 本文记录刷题过程中的整个思考过程,以供参考。主要内容涵盖: 题目分析设想 编写代码验证 查阅他人解法 思考总结 目录 1.两数之和 7.整数反转 9.回文…
leetcode217. 存在重复元素
给定一个整数数组,判断是否存在重复元素。 如果任何值在数组中出现至少两次,函数返回 true。如果数组中每个元素都不相同,则返回 false。 示例 1: 输入: [1,2,3,1] 输出: true 示例 2: 输入:…
leetcode 1 Two Sum Java & JavaScript解法
题目概况 Given an array of integers, return indices of the two numbers such that they add up to a specific target.…
LeetCode | Clone Graph
题目: Clone an undirected graph. Each node in the graph contains a label and a list of its neighb…
LeetCode | Scramble String
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings re…
Leetcode刷题笔记,palindromic strings回文
647. Palindromic Substrings 求回文,感觉有点难不知道为什么放在DP,不是用DP解 Given a string, your task is to count how many pal…
LeetCode108. Convert Sorted Array to Binary Search Tree
题目描述 Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 题目只有一句话…
LeetCode: 421. Maximum XOR of Two Numbers in an Array
Given a non-empty array of numbers, a0, a1, a2, … , an-1, where 0 ≤ ai < 231. Find the maximum result of ai…
LeetCode解题报告--Remove Nth Node From End of List
**题目:**Remove Nth Node From End of List Given a linked list, remove the nth node from the end of list and retu…