Title :
sort not case sensitive
Description:
Simple sort, but this time sort regardless of upper / lower case. So the input of
[ "Hello", "there", "I'm", "fine"]
is translated to
["fine", "Hello", "I'm", "there" ]
sort not case sensitive
Simple sort, but this time sort regardless of upper / lower case. So the input of
[ "Hello", "there", "I'm", "fine"]
is translated to
["fine", "Hello", "I'm", "there" ]
Sort characters
Write a function called sortGiftCode
(sort_gift_code
in Ruby) that accepts a string containing up to 26 unique alphabetical characters, and returns a string containing the same characters in alphabetical order.
sortGiftCode( 'abcdef' );//=> returns 'abcdef'
sortGiftCode( 'pqksuvy' );//=> returns 'kpqsuvy'
sortGiftCode( 'zyxwvutsrqponmlkjihgfedcba' );
//=> returns 'abcdefghijklmnopqrstuvwxyz'
Difference of 2
The objective is to obtain the various sets of integers that have a difference of 2 from a given array of integers. The result array should be sorted in ascending order of values.
So for example for the array of integers
[1,2,3,4] should return [[1,3],[2,4]]
[4,1,2,3] should also return [[1,3],[2,4]]
[1,23,3,4,7] should return [[1,3]]
Assume there are no duplicate integers in the array. The order of the integers in the input array should not matter.