赞
踩
算法–基础
2015-08-20 RGB Problem, IGT –字符串类
一个字符串,里面只有三种字符RGB 所有的R都在G的前面,所有的G都在B的前面, 将给定字符串按照此规律排序。
要求不允许用辅助空间,复杂度控制在O(N),遍历一遍。
解法 1 代码
2015-08-21 longest common sub–string, IGT
Please implement a function to find the longest common sub–string of two given string.
For example:
string a: abcdefg12345
string b: cdef234
longest common sub–string:cdef
解法 1 代码
2015-08-21 Expression AmazonTest2012Q1
Question: From AmazonTest2012Q1
Given an array with positive integers and another integer.
for example{7 2 4} 9, you are required to generate an equation,
by inserting operator add (“+”) and minus (“-“) among the array.
The left side of equation are consist of the array and the right
side of equation is the integer. here the result is 7-2+4=9
Rules:
Don’t include any space in the generated equation.
In case there is no way to create the equation, please output “Invalid”.
For example {1 1} 10, output is “Invalid”
The length of the integer array is from 1 to 15( include 1 and 15). If
the length is 1, for example the input {7} 7, the output is 7=7
There is no operator “+” or “-” in front of the first number:
Don’t change the order of the numbers. For example: {7 2 4} 9. 7-2+4=9 is
correct answer, 4-2+7=9 is wrong answer.
There could be multiple input, meaning your function could be called
multiple times. Do remember print a new line after the call.
[解法 1 代码] Working
2015-08-25 字符串中包含唯一字符的最长子串
Question: Given a string, find the longest sub sequence
which contains only unique characters.
解法 1 代码
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。