Categories

Design a simplified version of Twitter where users can post tweets, follow/unfollow another user and is able to see the 10 most recent tweets in the user’s news feed. Your design should support the following methods:

Categories

## LeetCode 350. Intersection of Two Arrays II

Given two arrays, write a function to compute their intersection.

Categories

## LeetCode 349. Intersection of Two Arrays

Given two arrays, write a function to compute their intersection.

Categories

## LeetCode 347. Top K Frequent Elements

Source: https://leetcode.com/problems/top-k-frequent-elements/

Given a non-empty array of integers, return the k most frequent elements.

Categories

## LeetCode 219. Contains Duplicate II

Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j]and the absolute difference between i and j is at most k.

Categories

Categories

## LeetCode 202. Happy Number

Write an algorithm to determine if a number is “happy”.

Categories

## LeetCode 136. Single Number

Source: https://leetcode.com/problems/single-number/

Given a non-empty array of integers, every element appears twice except for one. Find that single one.

Categories

## LeetCode 49. Group Anagrams

Given an array of strings, group anagrams together.

Categories

## LeetCode 36. Valid Sudoku

Determine if a 9×9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:

1. Each row must contain the digits `1-9` without repetition.
2. Each column must contain the digits `1-9` without repetition.
3. Each of the 9 `3x3` sub-boxes of the grid must contain the digits `1-9` without repetition.