题目如下: You are given an integer num. You will apply the following steps exactly two times: Pick a digit x (0 <= x <= 9). Pick another digit y (0 <= y < ...
分类:
其他好文 时间:
2020-06-03 23:33:43
阅读次数:
70
题目如下: Given a string s of zeros and ones, return the maximum score after splitting the string into two non-empty substrings (i.e. left substring and r ...
分类:
其他好文 时间:
2020-06-01 18:02:06
阅读次数:
65
如何使用DrJava 简介 DrJava是Java的轻量级编程环境,旨在促进测试驱动的软件开发。它包括一个智能程序编辑器,一个用于评估程序文本的交互窗格,一个源代码级调试器和一个单元测试工具。 官网 http://www.drjava.org/ 下载 https://sourceforge.net/ ...
分类:
编程语言 时间:
2020-06-01 12:16:41
阅读次数:
208
1. 可空类型修饰符(?)引用类型可以使用空引用表示一个不存在的值,而值类型通常不能表示为空。例如:string str=null; 是正确的,int i=null; 编译器就会报错。为了使值类型也可为空,就可以使用可空类型,即用可空类型修饰符"?“来表示,表现形式为"T?”例如:int? 表示可空 ...
题目描述 leetcode - 1:https://leetcode-cn.com/problems/two-sum/ 解题关键 hashmap的使用 碎碎念 题目比较简单,暴力过很容易,不过借助hash可以降低时间复杂度,但是增加了空间的消耗。学习了hashmap的使用 key:value 定义 ...
分类:
其他好文 时间:
2020-06-01 01:06:46
阅读次数:
77
使用了long。没有解决int的溢出问题。 class Solution { public: int divide(int dividend, int divisor) { //if (dividend == 0) return 0; //if (divisor == 1) return divid ...
分类:
其他好文 时间:
2020-05-31 18:17:56
阅读次数:
101
Manhattan Wiring 题意: There is a rectangular area containing n × m cells. Two cells are marked with “2”, and another two with “3”. Some cells are occup ...
分类:
其他好文 时间:
2020-05-31 16:26:04
阅读次数:
66
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. Example: Input: n = 4, k = 2 Output: [ [2,4], [3,4], [2,3], ...
分类:
其他好文 时间:
2020-05-31 13:17:49
阅读次数:
57
LeetCode的第一题,英文单词书中 Abandon 一般的存在,让我们来看一下题目: Given an array of integers, return indices of the two numbers such that they add up to a specific target. ...
分类:
编程语言 时间:
2020-05-31 11:10:15
阅读次数:
107