07 2021 档案

摘要:leetcode 1 两数之和 给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 target 的那 两个 整数,并返回它们的数组下标。 暴力求解:直接两重for循环 ``` class Solution { public int[] twoSum(int[ 阅读全文
posted @ 2021-07-17 20:25 梨云梦暖 阅读(81) 评论(0) 推荐(0)
摘要:[题目链接](https://leetcode-cn.com/problems/implement-stack-using-queues/ "题目链接") 题目描述: 请你仅使用两个队列实现一个后入先出(LIFO)的栈,并支持普通栈的全部四种操作(push、top、pop 和 empty)。 原题目 阅读全文
posted @ 2021-07-14 14:25 梨云梦暖 阅读(53) 评论(0) 推荐(0)
摘要:977. 有序数组的平方 链接:[leetcode](https://leetcode-cn.com/problems/squares-of-a-sorted-array/ "leetcode") 给你一个按非递减顺序 排序的整数数组 nums,返回每个数字的平方组成的新数组,要求也按非递减顺序 排 阅读全文
posted @ 2021-07-03 11:47 梨云梦暖 阅读(80) 评论(0) 推荐(0)
摘要:217. 存在重复元素 题目链接: [leetcode](https://leetcode-cn.com/problems/contains-duplicate/ "leetcode") 给定一个整数数组,判断是否存在重复元素。 如果存在一值在数组中出现至少两次,函数返回 true 。 如果数组中每 阅读全文
posted @ 2021-07-02 23:39 梨云梦暖 阅读(67) 评论(0) 推荐(0)
摘要:704 二分查找 [leetcode](https://leetcode-cn.com/problems/binary-search/ "leetcode") 给定一个 n 个元素有序的(升序)整型数组 nums 和一个目标值 target, 写一个函数搜索 nums 中的 target,如果目标值 阅读全文
posted @ 2021-07-02 23:02 梨云梦暖 阅读(42) 评论(0) 推荐(0)