Description: There are a total of n courses you have to take labelled from 0 to n - 1. Some courses may have prerequisites, for example, if prerequisi ...
分类:
其他好文 时间:
2021-04-21 12:51:08
阅读次数:
0
通常我们将 CANVAS 与 webGL 区分开 , 移动端和WEB端区分开 类似于这种关系: // 通过getElementById()方法获取canvas画布 var c2dx=document.getElementById('c2dx'); // 通过方法getContext()获取2d上下文 ...
分类:
Web程序 时间:
2021-04-20 14:57:58
阅读次数:
0
本文力求用最简的描述,演示C#开发和调用webapi。 所用的例子在.net5以及vs2019 v16.9.3中调试通过。 mvc框架实现的webapi和webapi框架的对比: 学过.net MVC的同学都知道,MVC中,c是可以返回字符串(多数是json字符串)的。因此,在不计体量的情况下,完全 ...
给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 输入: s = "abcabcbb"输出: 3 解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。示例 2: 输入: s = "bbbbb"输出: 1解释: 因为无重复字符的最长子串是 "b",所以其长度为 ...
分类:
其他好文 时间:
2021-04-19 15:17:18
阅读次数:
0
1 题目详情 给定一个排序数组和一个目标值,在数组中找到目标值,并返回其索引。如果目标值不存在于数组中,返回它将会被按顺序插入的位置。 你可以假设数组中无重复元素。 示例 1: 输入: [1,3,5,6], 5 输出: 2 示例 2: 输入: [1,3,5,6], 2 输出: 1 示例 3: 输入: ...
分类:
其他好文 时间:
2021-04-16 12:09:24
阅读次数:
0
此博客链接: 字符串中第二大的数 题目链接:https://leetcode-cn.com/problems/second-largest-digit-in-a-string/ 题目 给你一个混合字符串 s ,请你返回 s 中 第二大 的数字,如果不存在第二大的数字,请你返回 -1 。 混合字符串 ...
分类:
其他好文 时间:
2021-04-14 12:31:36
阅读次数:
0
1. 翻转二叉树:https://leetcode-cn.com/problems/invert-binary-tree/ 2. 二叉树展开为链表,关键在于找到递归部分:https://leetcode-cn.com/problems/flatten-binary-tree-to-linked-li ...
分类:
其他好文 时间:
2021-04-13 12:42:14
阅读次数:
0
Description: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row ...
分类:
其他好文 时间:
2021-04-12 12:32:28
阅读次数:
0
丑数 把只包含质因子2、3和5的数称作丑数(Ugly Number)。例如6、8都是丑数,但14不是,因为它包含质因子7。 习惯上我们把1当做是第一个丑数。求按从小到大的顺序的第N个丑数。 方法1:最小堆,基于sort.IntSlice实现heap 方法2:动态规划 func nthUglyNumb ...
分类:
其他好文 时间:
2021-04-12 11:41:41
阅读次数:
0
long long myPow(long long x, int n) { long long ans = 1; while(n){ if(n % 2 != 0){ ans *= x; ans %= modN; } x *= x; x %= modN; n /= 2; } return ans; } ...
分类:
其他好文 时间:
2021-04-08 13:55:01
阅读次数:
0