Skip to content

Instantly share code, notes, and snippets.

View arjrr's full-sized avatar

Arilson arjrr

View GitHub Profile
/**
* This question is asked by Amazon. Given a string representing the sequence of moves a robot vacuum makes,
* return whether or not it will return to its original position. The string will only contain L, R, U, and D characters,
* representing left, right, up, and down respectively.
*
* Ex: Given the following strings...
*
* "LR", return true
* "URURD", return false
* "RUULLDRD", return true
/**
* In this chapter, you’ll learn about the Big O notation for the different levels of scalability in two dimensions:
* • Execution time.
* • Memory usage.
*/
fun main() {}
/** Constant time *
* A constant time algorithm is one that has the same running time regardless of the size of the input.
/*
UBER
Description of Question
The goal is to write a function which takes a
list of string items and returns a list containing
unique items sorted based on their frequency in descending order
Example:
input = I -> am -> happy -> so -> I -> sing -> happy -> happy -> songs
output = happy -> I -> am -> so -> sing -> songs