Interview Practice - Algorithms
Implement an algorithm to determine if a string as all unique characters.
Two solutions, one with a data structure and one without.
Given a string, write a function to check if it is a permutation of a palindrome.
Write a function that replaces all spaces in a string with "%20".
Implement a method to perform basic string compression using the counts of repeated characters.
Input: Tact Coa
Output: True ("taco cat", "atco cta")Input: "Mr John Smith"
Output: "Mr%20John%20Smith"Input: "aabcccccaaa"
Output: "a2b1c5a3"You are given two sorted arrays, A and B. Write a function to merge B into A in sorted order.
Given a sorted array of strings that is interspersed with empty strings, write a function to find the location of a given string.
There are three types of edits that can be performed on strings: insert a character, remove a char, or replace a char. Given two strings, write a function to check if they are one edit or zero away.
Write a function to sort an array of strings so that all the anagrams are next to each other.
pale, ple -> true
pales, pale -> true
pale, bale -> true
pale, bake -> true