摘要:
什么是语法糖? 语法糖指简化语法,代码的基本逻辑没改变。 语法糖代码示例 squares_dict = {} for x in range(10): squares_dict[x] = x**2 列表推导 简单的方式生成列表 语法糖: squares_dict = {x: x**2 for x in 阅读全文
摘要:
题目描述: https://leetcode.cn/problems/reverse-nodes-in-k-group 给你链表的头节点 head ,每 k 个节点一组进行翻转,请你返回修改后的链表。 k 是一个正整数,它的值小于或等于链表的长度。如果节点总数不是 k 的整数倍,那么请将最后剩余的节 阅读全文
摘要:
题目描述: https://leetcode.cn/problems/reverse-linked-list-ii 给你单链表的头指针 head 和两个整数 left 和 right ,其中 left <= right 。请你反转从位置 left 到位置 right 的链表节点,返回 反转后的链表 阅读全文
摘要:
There is a function signFunc(x) that returns: 1 if x is positive. -1 if x is negative. 0 if x is equal to 0. You are given an integer array nums. Let 阅读全文
摘要:
You are given an array points where points[i] = [xi, yi] is the coordinates of the ith point on a 2D plane. Multiple points can have the same coordina 阅读全文
摘要:
Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]). Return the running sum of nums. Example 1: Input: nu 阅读全文