Skip to content

Android Playground

  • Algorithm Problems
  • My Android Apps
  • About Me

Algorithm Problems

August 4, 2019August 4, 2019 Coding Rabbit

LRU Cache

Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put.

Continue reading

August 3, 2019 Coding Rabbit

Add Two Numbers

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.

Continue reading

August 1, 2019 Coding Rabbit

Two Sum

Given an array of integers, return indices of the two numbers such that they add up to a specific target.

Continue reading

July 25, 2019July 25, 2019 Coding Rabbit

Maximal Square

Given a 2D binary matrix filled with 0’s and 1’s, find the largest square containing only 1’s and return its area.

Continue reading

July 25, 2019 Coding Rabbit

Find All Duplicates in an Array

Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.

Continue reading

July 23, 2019 Coding Rabbit

Number of Equivalent Domino Pairs

Given a list of dominoes, dominoes[i] = [a, b] is equivalent to dominoes[j] = [c, d] if and only if either (a==c and b==d), or (a==d and b==c) – that is, one domino can be rotated to be equal to another domino.

Continue reading

July 23, 2019 Coding Rabbit

Product of Array Except Self

Given an array nums of n integers where n > 1,  return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].

Continue reading

July 22, 2019July 22, 2019 Coding Rabbit

Container With Most Water

Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a container, such that the container contains the most water.

Continue reading

July 22, 2019July 22, 2019 Coding Rabbit

Letter Combinations of a Phone Number

Given a string containing digits from 2-9inclusive, return all possible letter combinations that the number could represent.

Continue reading

July 21, 2019July 21, 2019 Coding Rabbit

Spiral Matrix

Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.

Continue reading

Posts navigation

Older posts
Newer posts
Create a website or blog at WordPress.com
Android Playground
Create a website or blog at WordPress.com
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Subscribe Subscribed
    • Android Playground
    • Already have a WordPress.com account? Log in now.
    • Android Playground
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...
 

    Design a site like this with WordPress.com
    Get started