找到约 10000 条结果
  • 299. Bulls and Cows
    题目:You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a guess, you provide a hint that indicates how many digits in said guess match your secret number exactly in both digit an...
    2016-06-28
  • [LintCode] Palindrome Partitioning II
    Given a string s, cut s into some substrings such that every substring is a palindrome.
    2016-04-19
  • LeetCode65. Valid Number -- 判断合法数字
    Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => true
    2018-06-29
  • Set集合存储元素不重复的原因
    package com.itheima.demo02.Set; import java.util.HashSet; /* {代码...} */public class Demo02HashSetSaveString { {代码...} }
    2019-07-01
  • 字符串转16进制、ascii
    {代码...} 输出结果 {代码...}
    2022-03-22
  • Go 专栏|复合数据类型:数组和切片 slice
    原文链接: Go 专栏|复合数据类型:数组和切片 slice公司 Tony 老师这两天请假,找来了他的好朋友 Kevin 顶班,这两个人的风格真是相差十万八千里。Tony 性格缓慢,手法轻柔。到底有多轻呢?洗头发的时候我都怀疑他是不是怕把我头发弄湿。Kevin 则完全不同,嗓音洪亮,风风火火。说是洗头发,但我感觉他就是在扇我脑袋...
    2021-09-08
  • 用javascript分类刷leetcode20.字符串(图文视频讲解)
    给定两个字符串 text1 和 text2,返回这两个字符串的最长 公共子序列 的长度。如果不存在 公共子序列 ,返回 0 。一个字符串的 子序列 是指这样一个新的字符串:它是由原字符串在不改变字符的相对顺序的情况下删除某些字符(也可以不删除任何字符)后组成的新字符串。例如,"ace" 是 "abcde" 的子序列,但 "aec" 不是 "a...
    2023-01-04
  • Java 8 Strem基本操作
    本文提供了有关Java 8 Stream的深入概述。当我第一次读到的Stream API,我感到很困惑,因为它听起来类似Java I/O的InputStream,OutputStream。但Java 8 Stream是完全不同的东西。Streams是Monads,因此在为Java提供函数式编程方面发挥了重要作用:
    2019-01-09
  • golang-nsq系列(二)--nsqd源码解析
    上一篇初识了 nsq 三个模块(nsqd, nsqlookupd, nsqadmin)的 demo演示,本篇则从源码开始,一步一步去解析 nsqd 的执行流程和逻辑处理,学习别人优秀的项目架构,以期学以致用。
    2019-09-01
  • 基础Python代码练习
    在线课程的练习题 练习1 求从1到100的数字中所有能既能被3整除,又能被5整除的数字有哪些。 左闭右开原则range(1,101) 整除:% for x in range(1,101): if x%3==0 and x%5==0: print(x) else: pass 练习2: 输入一个字符串XM代理申请[链接] ■ 如果字符串长度大等于3,添加 ‘ing’ 到字符串的末尾 ■ 如果字符串是以 ‘ing’ ...
    2020-02-21
  • MATH40082选进算法
    MATH40082 (Computational Finance)Assignment No. 2: Advanced MethodsVersion 105453491 Background Theory1.1 Convertible BondsYou are asked to price a bond contract in which the holder has the option to choose between receivingthe principle F or alternatively receiving R underlying stocks with price...
    2023-04-04
  • LeetCode hot100系列——5. longest-palindromic-substring(动态规划)
    题目描述 [链接] 给定一个字符串 s,找到 s 中最长的回文子串。你可以假设 s 的最大长度为 1000。 示例 1: 输入: "babad"输出: "bab"注意: "aba" 也是一个有效答案。 示例 2: 输入: "cbbd"输出: "bb" 思路分析 暴力解法 解决一个问题如果没有思路,就要想办法从简单粗暴的解法开始,然后想办法优化它。以"babad"为例,...
    2019-08-18
  • ES6(七)—— Set & Map
    目录Set数据结构声明SetSet方法存储数据删除数据清空数据查找数据size长度读取数据get API & keys API & values API & entries APIforEach APIfor-of API修改数据数组去重ES6可以用Set处理Map数据结构(字典类型)之前对象的键都是字符串,会出错?map的key可以是任意类型如果实例化一个map对象Map方法添加/...
    2020-09-16
    1
  • [Leetcode] Minimum Window Substring 最小字符串窗口
    Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example, S = "ADOBECODEBANC" T = "ABC" Minimum window is "BANC". Note: If there is no such window in S that covers all characters in T, return the emtpy string "". If t...
    2015-09-05
    2
  • CMPUT 204
    CMPUT 204 Practice Test with SolutionsQuestion 1.Consider array A = [3, 8, 5, 9, 2, 7, 6, 4].Part (a)To sort the array A by the call MergeSort(A, 1, 8), how many recursive calls to MergeSort aremade? Show the first four such calls.Answer. If MergeSort(A, 1, 8) itself is counted, then totally 15 c...
    2022-03-27
  • MATH 170B解决办法
    HOMEWORK 3 SOLUTIONS (MATH 170B, WINTER 2022)DUE DATE: SEE CANVASREVISION NUMBER: 3.0SUBMITTING HOMEWORK ON GRADESCOPE: For non-computer problems, create a PDF file of your work by whatever means you prefer(scanning handwritten work with your phone, or using LaTeX to typeset your mathematics, eit...
    2023-01-18
  • leetcode 232 栈实现队列
    232. 用栈实现队列 使用栈实现队列的下列操作: push(x) -- 将一个元素放入队列的尾部。 pop() -- 从队列首部移除元素。 peek() -- 返回队列首部的元素。 empty() -- 返回队列是否为空。 示例: {代码...} 说明: 你只能使用标准的栈操作 -- 也就是只有 push to top, peek/pop from top, size, 和 is empty 操作是合法的。...
    2018-10-22