Sorts an array of strings alphabetically
@param {Array<String>} strArr - Array of strings to sort
@return {Array<String>} The sorted array
770767
function sortStrs(strArr) {
    return strArr.sort(function(s1, s2) {
        var lowerCaseS1 = s1.toLowerCase();
        var lowerCaseS2 = s2.toLowerCase();

        if (lowerCaseS1 < lowerCaseS2) {
            return -1;
        } else if (lowerCaseS1 > lowerCaseS2) {
            return 1;
        } else {
            return 0;
        }
    });
}
154205
function SetArr() {
  let arr = {}
  let set = {
    size: 0,
    clear() {
      set.size = 0
    },
    add(item) {
      let index = arr.indexOf(item)
      if (index !== -1) return arr
      arr.push(item)
      set.size = arr.length
      return set
    },
    delete(item) {
      let index = arr.indexOf(item)
      if (index === -1) return false
      arr.splice(index, 1)
      set.size = arr.length
      return true
    },
    [Symbol.iterator]: () => arr[Symbol.iterator]()
  }
  return set
}
229097
public static String[] splitToArray(String str, String separator, int limit, boolean isTrim, boolean ignoreEmpty){
		return toArray(split(str, separator, limit, isTrim, ignoreEmpty));
	}
158397
function(str) {
    var T = this, k, child, ret = [];
    if (str === undefined) {
      str = "";
    }
    if (T === undefined) {
      return [];
    }
    if (T.words > 0) {
      ret.push(str);
    }
    for (k in T.children) {
      if (T.children.hasOwnProperty(k)) {
        child = T.children[k];
        ret = ret.concat(child.getAllWords(str + k));
      }
    }
    return ret;
  }
257209
protected static function strContains($str, array $arr)
    {
        foreach ($arr as $a) {
            if (stripos($str, $a) !== false) {
                return true;
            }
        }
        return false;
    }
510657
function sortLinked(list) {
        var i, p, q, e, tail, numMerges, pSize, qSize, inSize = 1;
        do {
            p = list;
            list = null;
            tail = null;
            numMerges = 0;
            while (p) {
                numMerges++;
                q = p;
                pSize = 0;
                for (i = 0; i < inSize; i++) {
                    pSize++;
                    q = q.nextZ;
                    if (!q)
                        break;
                }
                qSize = inSize;
                while (pSize > 0 || (qSize > 0 && q)) {
                    if (pSize === 0) {
                        e = q;
                        q = q.nextZ;
                        qSize--;
                    }
                    else if (qSize === 0 || !q) {
                        e = p;
                        p = p.nextZ;
                        pSize--;
                    }
                    else if (p.z <= q.z) {
                        e = p;
                        p = p.nextZ;
                        pSize--;
                    }
                    else {
                        e = q;
                        q = q.nextZ;
                        qSize--;
                    }
                    if (tail)
                        tail.nextZ = e;
                    else
                        list = e;
                    e.prevZ = tail;
                    tail = e;
                }
                p = q;
            }
            tail.nextZ = null;
            inSize *= 2;
        } while (numMerges > 1);
        return list;
    }
1122124
function getComparator(sortOrder) {
  if (typeof sortOrder === 'function') {
    return sortOrder;
  }

  const comparators = {
    [ASC]: ascendingSort,
    [DESC]: descendingSort,
    [ASC_LENGTH]: lengthSort,
    [DESC_LENGTH]: lengthReverseSort
  };

  return comparators[sortOrder];
}
652330
public static List<String> split(String str, char separator, int limit, boolean isTrim, boolean ignoreEmpty){
		return split(str, separator, limit, isTrim, ignoreEmpty, false);
	}
224080
function sortArrayByIndex(array) {

  let ii = 0;
  let length = array.length;

  let output = [];

  for (; ii < length; ++ii) {
    output[array[ii].index] = array[ii];
    delete array[ii].index;
  };

  return (output);

}
328436
public static <T extends Comparable<? super T>> void shellSort( T[] arr )
    {
        int j, k = 0, gap;
        for ( ; GAPS[k] < arr.length; k++ ) ;
        
        while ( k-- > 0 ) {
            gap = GAPS[k];
            for ( int i = gap; i < arr.length; i++ ) {
                T tmp = arr[ i ];
                for ( j = i; 
                    j >= gap && tmp.compareTo( arr[ j - gap ] ) < 0; j -= gap ) {
                    arr[ j ] = arr[ j - gap ];
                }
                if ( j < i ) arr[ j ] = tmp;
            }
        }
    }
1118659
function(arr, iterator) {
  var i = arr.length - 1, index = null

  if(i >= 0){
    do {
      if(iterator(arr[i])) {
        index = i
        break
      }
    } while(i--)
  }

  return index
}
592918
function parseArray (parser) {
  const length = parseLength(parser)
  if (length === undefined) {
    return
  }
  if (length < 0) {
    return null
  }
  const responses = new Array(length)
  return parseArrayElements(parser, responses, 0)
}
369011
public static String[] sortStringArray(String[] array) {
        if (isEmpty(array)) {
            return new String[0];
        }
        Arrays.sort(array);
        return array;
    }
1025169
public static void shuffle(int[] arr, Random rand) {
        int size = arr.length;
        for (int i = size; i > 1; i--) {
            int tmp = arr[i-1];
            int r = rand.nextInt(i);
            arr[i-1] = arr[r];
            arr[r] = tmp;
        }
    }
350288
public static String getSortKey(String str) {
		StringBuilder ignoreChars = new StringBuilder();
		StringBuilder tailCaps = new StringBuilder(str.length() + 1);
		StringBuilder normChars = new StringBuilder(str.length() + 1 + tailCaps.capacity() + ignoreChars.capacity());
		
		for(int i=0; i<str.length(); i++) {
			char ch = str.charAt(i);
			
			if( isIgnoredChar(ch) ) {
				if( ch == 0x02BC ) {
					ch = 0x2020;
				}
				ignoreChars.append(ch);
				continue;
			}
			
			
			char lowerCh = Character.toLowerCase(ch);
			
			Character sortValue = UK_ALPHABET_MAP.get(lowerCh);
			if (sortValue != null) {
				normChars.append(sortValue);
				tailCaps.append(ch);
			}
			else {
				tailCaps.append(ch);
			}
			
		}
		
		normChars.append(" ");
		tailCaps.append(" ");
		ignoreChars.append(" ");
		
		normChars.append(tailCaps);
		normChars.append(ignoreChars);
		
		return normChars.toString();
	}
50893
public static List<String> split(String str, String separatorChars)
  {
    final String[] array = StringUtils.split(str, separatorChars);

    return Arrays.asList(array);
  }
588364
function sortBy(array, attr) {
  assert(Array.isArray(array));
  return array.sort(function(a,b) {
    a = a[attr];
    b = b[attr];
    return (a < b) ? -1 : ((a > b) ? 1 : 0);
  });
}