摘要:
Given a string s, return all the palindromic permutations (without duplicates) of it. Return an empty list if no palindromic permutation could be form 阅读全文
摘要:
Problem: Given a string, find the lexicographical minimum string keeping the order of alphabets same as the original string.For example: Solution: Thi 阅读全文
摘要:
Given an integer array ‘arr[]’ of size n, find sum of all sub-arrays of given array. Examples: If we take a close look then we observe a pattern. Let 阅读全文
摘要:
This solution is just a java version derived from this post. At first, lets look at the edge cases - Now the main algorithm works in following steps - 阅读全文
摘要:
We can also do it without modifying the input by using a variable prev to hold the a[i-1]; if we have to lower a[i] to match a[i-1] instead of raising 阅读全文
摘要:
Given an integer n, return 1 - n in lexicographical order. For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9]. Please optimize your algori 阅读全文
摘要:
Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. For example, Given nums = [0, 1, 3] return 2. Note: Your algorithm should run i... 阅读全文
摘要:
Given a list of non negative integers, arrange them such that they form the largest number. For example, given [3, 30, 34, 5, 9], the largest formed n 阅读全文