CNoodle
  • Home
  • Archives
  • Tags
  • About

[LeetCode] 165. Compare Version Numbers

Given two version strings, version1 and version2, compare them. A version string consists of revisions separated by dots ‘.’. The value of the revision is its integer conversion ignoring leading zeros
2020-06-24
#leetcode #java #string

[LeetCode] 1014. Best Sightseeing Pair

You are given an integer array values where values[i] represents the value of the ith sightseeing spot. Two sightseeing spots i and j have a distance j - i between them. The score of a pair (i < j)
2020-06-17
#leetcode #array #java #dynamic programming #greedy

[LeetCode] 787. Cheapest Flights Within K Stops

There are n cities connected by some number of flights. You are given an array flights where flights[i] = [fromi, toi, pricei] indicates that there is a flight from city fromi to city toi with co
2020-06-15
#leetcode #java #bfs #heap #graph #dijkstra

[LeetCode] 392. Is Subsequence

Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence of a string is a new string that is formed from the original string by deleting some (can be none)
2020-06-10
#leetcode #two pointer #java #dynamic programming #greedy #binary search

[LeetCode] 300. Longest Increasing Subsequence

Given an integer array nums, return the length of the longest strictly increasing subsequence. Example 1:Input: nums = [10,9,2,5,3,7,101,18]Output: 4Explanation: The longest increasing subsequenc
2020-06-06
#leetcode #array #java #binary search #LIS #dp

[LeetCode] 198. House Robber

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house
2020-05-29
#leetcode #array #java #dynamic programming #recursion #memorization

[LeetCode] 886. Possible Bipartition

We want to split a group of n people (labeled from 1 to n) into two groups of any size. Each person may dislike some other people, and they should not go into the same group. Given the integer n and t
2020-05-28
#leetcode #java #bfs #dfs #graph

[LeetCode] 259. 3Sum Smaller

Given an array of n integers nums and an integer target, find the number of index triplets i, j, k with 0 <= i < j < k < n that satisfy the condition nums[i] + nums[j] + nums[k] <
2020-05-28
#leetcode #array #two pointer #java #sort

[LeetCode] 394. Decode String

Given an encoded string, return its decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guara
2020-05-28
#leetcode #java #recursion #string #stack #javacript

[LeetCode] 91. Decode Ways

You have intercepted a secret message encoded as a string of numbers. The message is decoded via the following mapping: “1” -> ‘A’“2” -> ‘B’… “25” -> ‘Y’“26” -> ‘Z’ However, while decoding
2020-05-23
#leetcode #java #javascript #dynamic programming #string
1…3031323334…48

Search

Hexo Fluid