CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 1404. Number of Steps to Reduce a Number in Binary Representation to One

Given the binary representation of an integer as a string s, return the number of steps to reduce it to 1 under the following rules:If the current number is even, you have to divide it by 2.If the cur
2020-11-23
#leetcode #java #string #bit manipulation

[LeetCode] 1582. Special Positions in a Binary Matrix

Given an m x n binary matrix mat, return the number of special positions in mat. A position (i, j) is called special if mat[i][j] == 1 and all other elements in row i and column j are 0 (row
2020-11-14
#leetcode #array #hashmap #java

[LeetCode] 1283. Find the Smallest Divisor Given a Threshold

Given an array of integers nums and an integer threshold, we will choose a positive integer divisor, divide all the array by it, and sum the division’s result. Find the smallest divisor such that the
2020-11-07
#leetcode #array #java #binary search

[LeetCode] 135. Candy

There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following requirements: Each child must have at least one cand
2020-11-03
#leetcode #array #java #greedy

[LeetCode] 1219. Path with Maximum Gold

In a gold mine grid of size m * n, each cell in this mine has an integer representing the amount of gold in that cell, 0 if it is empty. Return the maximum amount of gold you can collect under the con
2020-10-30
#leetcode #java #dfs #backtracking

[LeetCode] 720. Longest Word in Dictionary

Given a list of strings words representing an English Dictionary, find the longest word in words that can be built one character at a time by other words in words. If there is more than one possible a
2020-10-29
#leetcode #hashmap #java #sort #string #trie

[LeetCode] 524. Longest Word in Dictionary through Deleting

Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string. If there are more than one possible results, retur
2020-10-29
#leetcode #array #two pointer #java #sort

[LeetCode] 1051. Height Checker

A school is trying to take an annual photo of all the students. The students are asked to stand in a single file line in non-decreasing order by height. Let this ordering be represented by the integer
2020-10-28
#leetcode #array #java #sort #bucket sort

[LeetCode] 948. Bag of Tokens

You start with an initial power of power, an initial score of 0, and a bag of tokens given as an integer array tokens, where each tokens[i] donates the value of tokeni. Your goal is to maximize the to
2020-10-26
#leetcode #two pointer #java #greedy #sort

[LeetCode] 456. 132 Pattern

Given a sequence of n integers a1, a2, …, an, a 132 pattern is a subsequence ai,aj, ak such that i < j < k and ai < ak < aj. Design an algorithm that takes a listof n numbers as input and
2020-10-24
#leetcode #java #treemap #stack #monotonic stack
1…2324252627…41

Search

Hexo Fluid