- 博客(12)
- 收藏
- 关注
原创 leetcode--3,Longest Substring Without Repeating Characters &&53. Maximum Subarray&&String.valueOf()
3,Longest Substring Without Repeating Characters题目:Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc",
2017-08-23 15:50:57
249
原创 字符串
本文为牛客网学习直通BAT算法精讲,大家可以作为课件使用字符串笔试面试技巧特点1,广泛性 (1),字符串可以看做字符类型的数组与数组排序,查找,调整有关 (2),很多其他类型的面试题可以看做字符串类型的面试题。注意:用Java实现字符串类型题目是,String是不可修改的,要掌握StringBuffer,StringBuilder类,和toCharArray方法。
2017-08-18 17:06:01
284
原创 String;StringBuffer;StringBuilder用法和区别
1,String类,内容一旦声明则不可变,如果变,则会改变String的引用地址,即创建一个新的类,比如:1 String s = "1234qwe";2 s = s+1;3 System.out.print(s);// result : 1234qwe1即创建一
2017-08-15 19:51:41
313
原创 leetcode--32.longest-valid-parentheses
题目:Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest valid parentheses substring is"(
2017-08-15 17:08:03
254
原创 leetcode--42. Trapping Rain Water
题目:Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2
2017-08-11 11:32:51
218
原创 leetcode --20. Valid Parentheses
题目:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are
2017-08-11 10:34:09
212
原创 LeetCode--150. Evaluate Reverse Polish Notation
题目:Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or another expression.Some examples: ["
2017-08-08 18:05:17
238
原创 leetcode--141. Linked List Cycle&&142. Linked List Cycle II
141. Linked List Cycle题目:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?分析:要确定一个链表中是否有环,设置两个指针,一个fast,一个慢slow,如果fast和slow相遇则证明有
2017-08-05 16:59:11
247
原创 LeetCode--137. Single Number II && 260. Single Number III之暴力搜法
137. Single Number II 题目:Given an array of integers, every element appears three times except for one, which appears exactly once. Find that single one.Note:Your algorithm should have a li
2017-08-03 16:51:05
285
原创 LeetCode——136. Single Number
题目:Given an array of integers, every element appears twiceexcept for one. Find that single one.Note: Your algorithm should have a linear runtime complexity. Could you implement it without
2017-08-02 20:20:36
326
原创 LeetCode——122. Best Time to Buy and Sell Stock II
题目:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie,
2017-08-01 17:34:02
243
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅