1. 题目 1.1 英文 Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb" , the answer is "abc" , which the length is 3. Given ...
1. 题目 1.1 英文 Given a string containing just the characters '(' , ')' , '{' , '}' , '[' and ']' , determine if the input string is valid. The brackets mu...
1. 题目 1.1 英文 Determine whether an integer is a palindrome. Do this without extra space. Some hints : Could negative integers be palindromes? (ie, -1) If you are thinking of converting the integer to s...
1. 题目 Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example 3: Input: 120 Output: 21 Note: Assume we are dealing wi...
准备定期刷一刷LeetCode上的题目,并且做一做笔记,这是第一篇。算法实现将采用Go语言。 1. 题目 Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have...
因为之前没有编程基础,最近才知道排序算法这个概念,原来平时在操作数组的时候是用到“算法”这玩意的。 从网上找了下资料,都一个来源;用$arr=array(1,43,54,62,21,66,32,78,36,76,39); 做例子排序。 1. 冒泡排序 1.1 原理 在要排序的一组数中,对当前还未排好的序列,从前往后对相邻的两个数依次进行比较和调整,让较大的数往下沉,较小的往上冒。即,每当两相邻的数...