摘要:
这是我遇到的一道校招题目: 给定一字符串只包含数字,请写一个算法,找出该字符串中的最长不重复子串(不重复是指子串中每一元素不同于子串中其他元素) 如: “120135435”最长不重复子串为 "201354" 要求用java或者c来写,我用了java。 /** * 思想: * 从头开始截取字符串,只 阅读全文
posted @ 2017-09-10 19:04
稀里糊涂林老冷
阅读(715)
评论(0)
推荐(0)
摘要:
最近在笔试的时候遇到碰一道算法题, 要求判断一个字符串是不是合法的ip地址。 将我的思路发出来分享一下,不一定正确,也不一定是最优的方法。希望能分享一些交流 要求用java或者c来实现,我的java代码: 阅读全文
posted @ 2017-09-10 19:01
稀里糊涂林老冷
阅读(11325)
评论(0)
推荐(0)
摘要:
Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might need to change the root of the tree, so the resul... 阅读全文
posted @ 2017-09-10 18:57
稀里糊涂林老冷
阅读(257)
评论(0)
推荐(0)
摘要:
In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different size but keep its original data.You're given a matrix represented by a two-dimensi... 阅读全文
posted @ 2017-09-10 18:40
稀里糊涂林老冷
阅读(297)
评论(0)
推荐(0)
摘要:
You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the corresponding places of nums2.Th... 阅读全文
posted @ 2017-09-10 18:25
稀里糊涂林老冷
阅读(213)
评论(0)
推荐(0)
摘要:
Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below.American keyboardExample 1:Input: ["Hello", "Alaska", "D... 阅读全文
posted @ 2017-09-10 18:14
稀里糊涂林老冷
阅读(226)
评论(0)
推荐(0)
摘要:
You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is completely ... 阅读全文
posted @ 2017-09-10 18:09
稀里糊涂林老冷
阅读(310)
评论(0)
推荐(0)
摘要:
Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of the corresponding kind. You need to distribute these... 阅读全文
posted @ 2017-09-10 18:04
稀里糊涂林老冷
阅读(251)
评论(0)
推荐(0)
摘要:
leetcode算法: Find Bottom Left Tree ValueGiven a binary tree, find the leftmost value in the last row of the tree.Example 1:Input: 2 / \ 1 3Output:1Example 2: Input: 1 / \ 2 ... 阅读全文
posted @ 2017-09-10 17:32
稀里糊涂林老冷
阅读(285)
评论(0)
推荐(0)