All Posts

Leetcode 455: Assign Cookies

You are a parent with several children and a set of cookies. Each child has a greed factor, which is the minimum size of a cookie they will be happy with. Each cookie also has a size. Your task is to distribute the cookies such that you maximize the number of content children. Each child can receive at most one cookie, and each cookie can only be given to one child.

Leetcode 456: 132 Pattern

Given an array of integers, determine if there exists a subsequence of three integers nums[i], nums[j], nums[k] where i < j < k and nums[i] < nums[k] < nums[j]. Return true if such a subsequence exists, otherwise return false.

Leetcode 457: Circular Array Loop

You are playing a game with a circular array where each element indicates how many steps to move forward or backward. Determine if there exists a cycle in the array where the cycle has more than one element and all elements in the cycle move in the same direction. Return true if such a cycle exists, otherwise return false.

Leetcode 474: Ones and Zeroes

Given an array of binary strings strs and two integers m and n, return the size of the largest subset of strs such that there are at most m zeros and n ones in the subset.

Leetcode 475: Heaters

You are given the positions of houses and heaters along a horizontal line. Your task is to find the minimum radius required for the heaters so that all houses are within the heater’s warm radius.

Leetcode 477: Total Hamming Distance

The Hamming distance between two integers is the number of positions at which the corresponding bits differ. Given an integer array nums, return the sum of Hamming distances between all pairs of integers in nums.